void UART_Action(uint8 *dat,uint8 len) { uint8 i; UART_SendString(dat,len); UART_SendString("\r\n",2); for(i=0;i<4;i++) { if(*dat!=UART_Header[i])return ; dat++; } if(*dat=='0') { LCD1602_AreaClear(0,0,16); LCD1602_Show(0,0,dat+2,len-6); EEPROM_WriteString(0x40,dat+2,len-6); EEPROM_WriteString(0x40+len-6,spaces,22-len); } else if(*dat=='1') { LCD1602_AreaClear(0,1,16); LCD1602_Show(0,1,dat+2,len-6); EEPROM_WriteString(0x80,dat+2,len-6); EEPROM_WriteString(0x80+len-6,spaces,22-len); } }
void main() { uint8 temp[20]; Timer0_Init(1); UART_Conf(9600); LCD1602_Init(); EEPROM_ReadString(0x40,16,temp); LCD1602_Show(0,0,temp,16); EEPROM_ReadString(0x80,16,temp); LCD1602_Show(0,1,temp,16); while(1) { UART_Driver(); } }
void main() { uint8 dat; uint16 temp; uint8 LcdBuff[6]; LCD1602_Init(); while(1) { dat=PCF8591_Read(0); temp=dat*125/64; LcdBuff[0]=temp/100+'0'; LcdBuff[1]='.'; LcdBuff[2]=temp/10%10+'0'; LcdBuff[3]=temp%10+'0'; LcdBuff[4]='V'; LcdBuff[5]='\0'; LCD1602_Show(0,0,LcdBuff,5); } }
void main(void) { uchar display[6]; WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer Clock1MHZ_Init(); ADC10_Init(); LCD1602_Init(); TLC5615_Init(); Button_Init(); __enable_interrupt(); ADC10_Enable(); while(1) { TLC5615_Convert((uint)(DA_Output * 512 / 3.555f)); __delay_cycles(50000); NumberToString(display, ADC_Convert(ADC_Value[0])); LCD1602_Show(0, 0, display); __delay_cycles(50000); } }