theredkid
Newbie level 5
- Joined
- Apr 21, 2011
- Messages
- 10
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,353
Hello,
Could you maybe check my following ccs c code used to control a relay driver for turning on/off leds. Unfortunately does not work.
Could you maybe check my following ccs c code used to control a relay driver for turning on/off leds. Unfortunately does not work.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 #include <18F452.h> #define Fosc 16000000 //Baudrate #use delay(clock=Fosc,crystal=4000000) #fuses H4,PROTECT,BROWNOUT,PUT,NOWDT,NODEBUG,NOWDT,NOCPD,CCP2C1,STVREN,NOLVP void OneSC() { delay_ms(1000); } void main() { unsigned char a; set_tris_b(0x00); output_b(0x01); while(1) { OneSC(); for(a=1;a<6;a++) { output_b(0x03); delay_ms(250); // output_b(0x01); // delay_ms(250); // } OneSC(); output_b(0x05); Delay_ms(6000); output_b(0x01); OneSC(); output_b(0x09); Delay_ms(3000); output_b(0x01); } }
Attachments
Last edited: