int main(void) { char display_string1[] = "*Hello Amigos. Rolling Banner!*"; char display_string2[] = "+-+-+-+-+"; uint8_t i; init_gpio(); // Initialize GPIO init_timer_A(); // Initialize TIMER0->TIMERA as 16-bit, one-shot and counts down init_timer_B(); // Init TIMER0B as 16-bit, periodic and counts down nvic_init(); // Init NVIC for TIMER0B init_pushButton(); // Initialize LCD display LCD_init(); PWM_init(); for(i=0; display_string1[i] != '\0'; i++) { send_data(display_string1[i]); delay_timer(100); // Since screen has enough to display 16 chars per line, if going off line, start shifting screen. if ( i >= 14 ) send_command(0x18); } send_command(0x2); // Return cursor home send_command(0xC0); // Go to line 2 for(i=0; display_string2[i] != '\0'; i++) { send_data(display_string2[i]); delay_timer(100); // Since screen has enough to display 16 chars per line, if going off line, start shifting screen. if ( i >= 14 ) send_command(0x18); } interrupt_timer(scroll_delay); // Interrupt timer handler scrolls the screen //send_command(0x18); // Shift display to the right by 1 //send_command(0x8); // Turn display off //send_command(0xF); // Turn display on, cursor ON, cursor position ON //GPIOF->DATA |= (1UL << 3); //LED ON //GPIOF->DATA &= ~(1UL << 3); //LED OFF while(1) {} }
int main(void) { init_gpio(); /* Setup Timers */ init_timer_0A(); init_timer_0B(); // Default to theremin on startup turn_on_red_LED(); PWM_init(); init_ADC(); init_nvic(); init_pushButton(); while(1) {} }