devakuamr Posted November 28, 2011 Report Share Posted November 28, 2011 HI SIR CAN U TEACH ME WHATS THE PROGRAMMING OF MY PROJECT APPENDIX A//====================================================================//Author: Devakumar//Project: Solar powered surveillance system// This source code is used in my project]//====================================================================#include <16f877a.h>#include <math.h>#include <stdlib.h>#fuses HS,NOWDT,NOPROCTECT,NOLVP#use delay (clock=20000000)#use rs232(baud=19200,xmit=PIN_C6,rcv=PIN_C7,PARITY=N.BITS=8)#org 0x100,0x1FFF void loader 16f877 (void) {} //16f677A//input definition//====================================================================#define STO_in_A PIN_A1 //pin3#define STO_in_B PIN_A2 //pin4#define CONT_A PIN_A3 //manually control //pin5#define CONT_B PIN_A4 // Automatic // pin6#define cont_C PIN_A5 // pin7#define SENSOR PIN_C1 //pin16//output definition//====================================================================#define PIC_A 0 //PIN_B7#define PIC_B 1 //PIN_B6#define CAM_A 2 //PIN_B5#define CAM_B 3 //PIN_B4#define BUZZER 4 //PN_B3#define Power_A 5 //PIN_B2#define Power_B 6 //PIN_B1#define ON 1#define OFF 0#define NO_DELAY 0Int 16 adc_result;Int channel_mov, channel _ photo, t;Int8 ctr ;Int8 value;void outssignal(int8 signal_out,int8 state 1,int8 delay_ms1){If signal _out==0){If(state 1 ==0) output_low(PIN_B7); //pin40else output_high(PIN_B7);}if(signal_out==1){If(state1==0) output_low(pin_B6); //pin39else output _high(pin_B6);}if(signal_out==2){If(state1==0) output_low(pin_B5); //pin38else output _high(pin_B5);}if(signal_out==3){If(state1==0) output_low(pin_B4); //pin37else output _high(pin_B4);}if(signal_out==4){If(state1==0) output_low(pin_B3); //pin36else output _high(pin_B3);}if(signal_out==5){If(state1==0) output_low(pin_B2); //pin35else output _high(pin_B3);}if(signal_out==6){If(state1==0) output_low(pin_B1); //pin34else output _high(pin_B1);}delay_ms(delay_ms1);}//main function//====================================================================main(){set_tris_A(0b11111111);setup_adc(ADC_CLOCK_INTERNAL);setup_adc_ports(RA0_ANALOG); //setup_adc_ports(RA0t=20;printf(Start\r\n Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.