36 |
PCFG2=1; |
PCFG2=1; |
37 |
PCFG3=1; |
PCFG3=1; |
38 |
|
|
39 |
//Result is right justified |
//Result is left justified |
40 |
ADFM=1; |
ADFM=0; |
41 |
|
|
42 |
//Fire up for A/D converter module |
//Fire up for A/D converter module |
43 |
ADON=1; |
ADON=1; |
88 |
} |
} |
89 |
|
|
90 |
void update_lcd(void) |
void update_lcd(void) |
91 |
{ |
{ |
|
int i = 0, horizontal = 0, vertical = 0; |
|
|
char alfa[2][LCD_LENGTH]; |
|
|
|
|
|
|
|
|
static char current_row = 0; |
|
|
static char current_char = 0; |
|
92 |
char toLCD0[LCD_LENGTH], toLCD1[LCD_LENGTH]; |
char toLCD0[LCD_LENGTH], toLCD1[LCD_LENGTH]; |
93 |
char B1[16]; |
char B1[LCD_LENGTH]; |
94 |
|
char sprintF[LCD_LENGTH]; |
95 |
lcd_goto(0x00); |
lcd_goto(0x00); |
96 |
sprintf(toLCD0, "%s", "Ejdesgaard"); |
sprintf(toLCD0, "%s", "Ejdesgaard"); |
97 |
if(RB1) |
if(RB1) |
105 |
lcd_puts(B1); |
lcd_puts(B1); |
106 |
|
|
107 |
lcd_goto(0x40); |
lcd_goto(0x40); |
108 |
// sprintf(toLCD1, "%s", "Test"); |
sprintf(sprintF,"%08d%08d", global_Pot_Hi, global_Pot_Lo); |
109 |
lcd_puts("Test1"); |
lcd_puts(sprintF); |
110 |
|
|
111 |
} |
} |
112 |
|
|
132 |
{ |
{ |
133 |
global_Pot_Hi = ADRESH; |
global_Pot_Hi = ADRESH; |
134 |
global_Pot_Lo = ADRESL; |
global_Pot_Lo = ADRESL; |
135 |
GODONE = 0; |
GODONE = 1; |
136 |
} |
} |
137 |
|
|
138 |
update_lcd(); |
update_lcd(); |