// Displays a welcome message and plays the initial music. void initialize() { load_custom_characters(); // load the custom characters play_from_program_space(welcome); print_two_lines_delay_1s(welcome_line1,welcome_line2); print_two_lines_delay_1s(demo_name_line1,demo_name_line2); print_two_lines_delay_1s(instructions_line1,instructions_line2); clear(); print_from_program_space(instructions_line3); lcd_goto_xy(0,1); print_from_program_space(instructions_line4); while(!(wait_for_button_and_beep() & BUTTON_B)); play_from_program_space(thank_you_music); print_two_lines_delay_1s(thank_you_line1,thank_you_line2); }
// Initializes the 3pi, displays a welcome message, calibrates, and // plays the initial music. void initialize() { // This must be called at the beginning of 3pi code, to set up the // sensors. We use a value of 2000 for the timeout, which // corresponds to 2000*0.4 us = 0.8 ms on our 20 MHz processor. pololu_3pi_init(2000); load_custom_characters(); // load the custom characters play_from_program_space(welcome); print_two_lines_delay_1s(welcome_line1,welcome_line2); print_two_lines_delay_1s(demo_name_line1,demo_name_line2); print_two_lines_delay_1s(instructions_line1,instructions_line2); clear(); print_from_program_space(instructions_line3); lcd_goto_xy(0,1); print_from_program_space(instructions_line4); while(!(wait_for_button_and_beep() & BUTTON_B)); play_from_program_space(thank_you_music); print_two_lines_delay_1s(thank_you_line1,thank_you_line2); }