Copper Masud
Newbie level 4
- Joined
- May 2, 2014
- Messages
- 7
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 48
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 // LCD module connections sbit LCD_RS at RB4_bit; sbit LCD_EN at RB5_bit; sbit LCD_D4 at RB0_bit; sbit LCD_D5 at RB1_bit; sbit LCD_D6 at RB2_bit; sbit LCD_D7 at RB3_bit; sbit LCD_RS_Direction at TRISB4_bit; sbit LCD_EN_Direction at TRISB5_bit; sbit LCD_D4_Direction at TRISB0_bit; sbit LCD_D5_Direction at TRISB1_bit; sbit LCD_D6_Direction at TRISB2_bit; sbit LCD_D7_Direction at TRISB3_bit; // End LCD module connections char txt1[8]; int overflow=0; int time=0; void interrupt() { if(t0if==1) { t0if_bit=0; overflow++; } } void main() { lcd_init(); lcd_cmd(_lcd_clear); lcd_cmd(_lcd_cursor_off); option_reg=0b00000111; gie_bit=1; t0ie_bit=1; t0if_bit=0; while(1) { if(overflow==15) { time++; inttostr(time,txt1); lcd_out(1,3,txt1); } } }
Last edited by a moderator: