int16_t parse_cmd_lcd_shift(char *cmd, char *output, uint16_t len) { if (strlen(cmd) < 1) return ECMD_ERR_PARSE_ERROR; if (!strncmp_P(cmd + 1, PSTR("right"), 5)) hd44780_shift(1); else if (!strncmp_P(cmd + 1, PSTR("left"), 4)) hd44780_shift(0); else return ECMD_ERR_PARSE_ERROR; return ECMD_FINAL_OK; }
int main(void) { char msg[]="A nice long message for you to read !!!!" "A second very long message to read :) !!"; /* set up systick */ if(SysTick_Config(SystemCoreClock/1000)) { while(1); } /* set the pins up */ init_io(); /* start the lcd */ hd44780_init(); hd44780_write_string(msg); while(1) { delayms(300); hd44780_shift(0,1); } return 0; }
int16_t parse_cmd_lcd_shift(char *cmd, char *output, uint16_t len) { if (strlen(cmd) < 1) return ECMD_ERR_PARSE_ERROR; if (!strncmp_P(cmd + 1, PSTR("right"), 5)) { hd44780_shift(1,1); #ifdef HD44780_MULTIENSUPPORT hd44780_shift(1,2); #endif } else if (!strncmp_P(cmd + 1, PSTR("left"), 4)) { hd44780_shift(0,1); #ifdef HD44780_MULTIENSUPPORT hd44780_shift(0,2); #endif } else return ECMD_ERR_PARSE_ERROR; return ECMD_FINAL_OK; }