void test_Oled(void) { int i; ExpanderSetbit(7,0); HAL_Delay(100); ExpanderSetbit(7,1); HAL_Delay(100); ssd1306Init(0); ssd1306ClearScreen(); ssd1306Refresh(); ssd1306DrawBmp(Pacabot_bmp, 1, 10, 128, 40); ssd1306Refresh(); HAL_Delay(3500); ssd1306ClearScreen(); ssd1306Refresh(); // miniature bitmap display ssd1306DrawCircle(40, 30, 20); // ssd1306DrawCircle(50, 20, 10); ssd1306FillCircle(100, 40, 15); ssd1306DrawRect(110, 3, 15, 6); ssd1306FillRect(1, 60, 10, 20); ssd1306DrawLine(5, 45, 70, 60); ssd1306Refresh(); HAL_Delay(5500); ssd1306ClearScreen(); for (i = 0; i <= 100; i+=2) { ssd1306ProgressBar(10, 20, i); // HAL_Delay(1); ssd1306Refresh(); } ssd1306ShiftFrameBuffer(8); ssd1306DrawString(13, 1, "Oled 128x64", &Font_8x8); // 3x6 is UPPER CASE only ssd1306Refresh(); HAL_Delay(1500); ssd1306DrawString(1, 25, "Driver for STM32f4xx", &Font_5x8); // 3x6 is UPPER CASE only ssd1306Refresh(); HAL_Delay(500); ssd1306DrawString(1, 35, "2 Wire SPI mode", &Font_5x8); // 3x6 is UPPER CASE only ssd1306Refresh(); HAL_Delay(1500); ssd1306DrawString(10, 55, "BY PLF, PACABOT TEAM", &Font_3x6); // 3x6 is UPPER CASE only ssd1306Refresh(); HAL_Delay(5000); ssd1306ClearScreen(); ssd1306Refresh(); }
void joystickTest(void) { int state; while(expanderJoyState()!=JOY_LEFT) { state = expanderJoyState(); ssd1306ClearScreen(); ssd1306DrawCircle(60,10, 3); ssd1306DrawCircle(60,30, 3); ssd1306DrawCircle(50,20, 3); ssd1306DrawCircle(70,20, 3); switch (state) { case JOY_UP: ssd1306FillCircle(60,10, 3); break; case JOY_DOWN: ssd1306FillCircle(60,30, 3); break; case JOY_LEFT: ssd1306FillCircle(50,20, 3); break; case JOY_RIGHT: ssd1306FillCircle(70,20, 3); break; } ssd1306Refresh(); } ssd1306FillCircle(50,20, 3); ssd1306Refresh(); HAL_Delay(1000); antiBounceJoystick(); }
int test_oled1(void) { int i; ssd1306Init(0); ssd1306Refresh(); ssd1306ClearScreen(); ssd1306DrawBmp(Pacabot_bmp, 1, 1, 128, 40); ssd1306Refresh(); HAL_Delay(3500); ssd1306ClearScreen(); ssd1306Refresh(); // miniature bitmap display ssd1306DrawCircle(40, 30, 20); // ssd1306DrawCircle(50, 20, 10); ssd1306FillCircle(100, 40, 15); ssd1306DrawRect(110, 3, 15, 6); ssd1306FillRect(1, 60, 10, 20); ssd1306DrawLine(5, 45, 70, 60); ssd1306Refresh(); HAL_Delay(5500); ssd1306ClearScreen(); for (i = 0; i <= 100; i++) { ssd1306ProgressBar(10, 20, i); HAL_Delay(1); ssd1306Refresh(); } ssd1306ShiftFrameBuffer(8); ssd1306DrawString(13, 1, "Oled 128x64", &Font_8x8); // 3x6 is UPPER CASE only ssd1306Refresh(); HAL_Delay(1500); ssd1306DrawString(1, 25, "Driver for STM32f10x", &Font_5x8); // 3x6 is UPPER CASE only ssd1306Refresh(); HAL_Delay(500); ssd1306DrawString(1, 35, "4 Wire SPI mode", &Font_5x8); // 3x6 is UPPER CASE only ssd1306Refresh(); HAL_Delay(1500); ssd1306DrawString(10, 55, "BY PLF ALL RIGHTS RESERVED", &Font_3x6); // 3x6 is UPPER CASE only ssd1306Refresh(); HAL_Delay(5000); ssd1306ClearScreen(); ssd1306Refresh(); return 0; }