This is an old revision of the document!
#include <pololu/3pi.h> int main() { delay_ms(3000); while(1) { for(int i = 0; i < 4; i++){ set_motors(50,50); delay_ms(500); set_motors(0,50); delay_ms(680); } set_motors(0,0); delay_ms(5000); } }
#include <pololu/3pi.h> int main() { delay_ms(3000); while(1) { set_motors(50,50); delay_ms(500); set_motors(0,50); delay_ms(2200); set_motors(50,50); delay_ms(500); set_motors(50,0); delay_ms(2200); set_motors(0,0); delay_ms(2000); } }
#include <pololu/3pi.h> int main() { int count; while(1) { count = analog_read(TRIMPOT)/128; //ümardub täisarvuks clear(); for(int i = 0; i < count; i++){ print_character('|'); } lcd_goto_xy(0,1); print("C: "); print_long(count); delay_ms(300); } }
#include <pololu/3pi.h> int main() { char text[] ="Hello"; while(1) { for(int i = 4; i >= 0; i--){ clear(); for(int j = i; j <= 4; j++){ print_character(text[j]); } delay_ms(200); } lcd_scroll(LCD_RIGHT, 8, 250); } }
#include <pololu/3pi.h> #include <stdio.h> int main() { lcd_init_printf(); int count[] = {0, 0, 0}; unsigned long time; time = get_ms(); while(1) { unsigned char button = get_single_debounced_button_press(ANY_BUTTON); if (button & TOP_BUTTON) count[2]++; if (button & MIDDLE_BUTTON) count[1]++; if (button & BOTTOM_BUTTON) count[0]++; if(get_ms() - time > 100){ clear(); printf("A%2d B%2d\nC%2d", count[0], count[1], count[2]); time = get_ms(); } } }
#include <pololu/3pi.h> int main() { while(1) { unsigned char button = get_single_debounced_button_press(ANY_BUTTON); if (button & TOP_BUTTON) stop_playing(); if (button & BOTTOM_BUTTON){ if(!is_playing()) play("!L16 V15 cdefgab>cbagfedcdefgab>cbagfedcdefgab>cbagfedc"); } } }