c - MPLAB PIC chip security alarm code advice -
i'm pretty new mplab , c coding please bare me things obvious , seem stupid me still getting grips software there pretty hard see. firstly getting error:
ake: * no rule make target 'build/default/production/alarmcode.o'. stop. build failed (exit value 2, total time: 102ms)**
also, can tell me how far off @ succeeding code, it's security circuit using pir sensor, has 3 leds show system state , buzzer when triggered. code below thank you.
*/ #include <stdio.h> #include <stdlib.h> sbit sensor_ip @ rc3_bit; // sensor i/p sbit led1 @ rb2_bit; // green led o/p sbit led2 @ rb1_bit; // yellow led sbit led3 @ rb0_bit; // red led unsigned short trigger, counter; void get_delay(){ delay_ms(300); } void main() { intconbits.gie = 1; //global interrupt enable on intconbits.tmr0ie = 1; //enable interrupt timer0 overflow //1 1 1 = 1:256, fosc/4/256 trisio = 0b00101000; // rc3, 5 i/p's, rest o/p's gpio = 0; sound_init(&gpio,2); // blink led @ startup led1 = 1; led2 = 1; led3 = 1; get_delay(); led1 = 0; led2 = 0; led3 = 0; get_delay(); led1 = 1; led2 = 1; led3 = 1; get_delay(); led1 = 0; get_delay(); led1 = 1; led2 = 1; led3 = 1; get_delay(); led2 = 0; led3 = 0; delay_ms(60000); // 45 sec delay pir module stabilization counter = 0; trigger = 0; { while (!sensor_ip) { // sensor i/p low sound_play(3725, 600); delay_ms(500); trigger = 1; counter = 0; led2 = 1; } if (trigger) { sound_play(3570, 600); delay_ms(500); counter = counter+1; if(counter == 10) trigger=0; led3 = 1; } }while(1); } end main()
Comments
Post a Comment