va_cristi
Newbie level 4
- Joined
- Oct 18, 2012
- Messages
- 6
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,314
Hi,
Please help me modify this program.
I would like to make LEDs of PORTB to PORTC to continue.
Thanks in advance.
I have the following code:
Please help me modify this program.
I would like to make LEDs of PORTB to PORTC to continue.
Thanks in advance.
I have the following code:
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 unsigned int cnt=0; bit up; bit down; const char number1[80]={0x00,0x01,0x03,0x06,0x0c,0x18,0x30,0x60,0xc0,0x81}; char count; void main() { TRISD=0xFF; TRISB=0x00; TRISC=0x00; do { if(portd.f0==1){ up=1; } if(portd.f1==1){ down=1; } if(up && portd.f0==0){ up=0; cnt++; // if(cnt>9999){ if(cnt>32){ //cnt=7; cnt=0; } } if(down && portd.f1==0){ down=0; --cnt; // if(cnt>9999){ if(cnt>32){ //cnt=0; cnt=7; } } count = cnt/1; PORTB = number1[count]; Delay_ms(5); } while(1); }
Last edited by a moderator: