Exemplo n.º 1
0
void testPostSensors()
{
    telemetersInit();
    telemetersStart();

    while (expanderJoyFiltered() != JOY_LEFT)
    {
        ssd1306ClearScreen(MAIN_AREA);

        if (fabs(getTelemeterSpeed(TELEMETER_DL)) > 500)
        {
            ssd1306FillRect(0, 58, 5, 5);
        }
        //      else
        //      {
        //      ssd1306DrawRect(0,49,5,5);
        //      }

        //      ssd1306FillRect(0,0,5,5);
        //      ssd1306DrawRect(0,0,5,5);

        if (fabs(getTelemeterSpeed(TELEMETER_DR)) > 500)
        {
            ssd1306FillRect(49, 58, 5, 5);
        }
        //      else
        //      {
        //      ssd1306DrawRect(49,49,5,5);
        //      }

        //      ssd1306FillRect(49,49,5,5);
        //
        //      ssd1306DrawRect(49,49,5,5);
        //
        //      ssd1306FillRect(49,0,5,5);
        //
        //      ssd1306DrawRect(49,0,5,5);

        ssd1306PrintIntAtLine(55, 1, "FL", (int32_t) getTelemeterSpeed(TELEMETER_FL), &Font_5x8);
        ssd1306PrintIntAtLine(55, 2, "FR", (int32_t) getTelemeterSpeed(TELEMETER_DL), &Font_5x8);
        ssd1306PrintIntAtLine(55, 3, "DL", (int32_t) getTelemeterSpeed(TELEMETER_DR), &Font_5x8);
        ssd1306PrintIntAtLine(55, 4, "DR", (int32_t) getTelemeterSpeed(TELEMETER_FR), &Font_5x8);
        ssd1306Refresh();
    }
    telemetersStop();
}
Exemplo n.º 2
0
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();
}
Exemplo n.º 3
0
void print_cell_state (walls cell_state)
{
    #ifdef PRINT_WALLS_DETECTED
    ssd1306ClearRect(64,DISPLAY_OFFSET,54,5);
    ssd1306ClearRect(64,DISPLAY_OFFSET,5,54);
    ssd1306ClearRect(113,DISPLAY_OFFSET,5,54);

    if (cell_state.front == WALL_PRESENCE)
    {
        ssd1306FillRect(64,DISPLAY_OFFSET,54,5);
    }
    if (cell_state.left == WALL_PRESENCE)
    {
        ssd1306FillRect(64,DISPLAY_OFFSET,5,54);
    }
    if (cell_state.right == WALL_PRESENCE)
    {
        ssd1306FillRect(113,DISPLAY_OFFSET,5,54);
    }
    #endif
    #ifdef PRINT_CELL_STATE_BLEUTOOTH
    if (cell_state.front == WALL_PRESENCE)
    {
        bluetoothPrintf("_");
    }
    if (cell_state.left == WALL_PRESENCE)
    {
        bluetoothPrintf("|");
    }
    else
    {
        bluetoothPrintf(" ");
    }
    if (cell_state.right == WALL_PRESENCE)
    {
        bluetoothPrintf("|");
    }
    bluetoothPrintf("\n");
    #endif
}
Exemplo n.º 4
0
void testWallsSensors()
{
    telemetersInit();
    telemetersStart();
    while (expanderJoyFiltered() != JOY_LEFT)
    {
        ssd1306ClearScreen(MAIN_AREA);
        if (getWallPresence(FRONT_WALL) == TRUE)
        {
            ssd1306FillRect(0, 59, 54, 5);
        }
        else
        {
            ssd1306DrawRect(0, 59, 54, 5);
        }
        if (getWallPresence(LEFT_WALL) == TRUE)
        {
            ssd1306FillRect(0, 10, 5, 54);
        }
        else
        {
            ssd1306DrawRect(0, 10, 5, 54);
        }
        if (getWallPresence(RIGHT_WALL) == TRUE)
        {
            ssd1306FillRect(49, 10, 5, 54);
        }
        else
        {
            ssd1306DrawRect(49, 10, 5, 54);
        }
        ssd1306PrintIntAtLine(60, 1, "FL ", (uint32_t) (getTelemeterDist(TELEMETER_FL) * 10.00), &Font_5x8);
        ssd1306PrintIntAtLine(60, 2, "DL ", (uint32_t) (getTelemeterDist(TELEMETER_DL) * 10.00), &Font_5x8);
        ssd1306PrintIntAtLine(60, 3, "DR ", (uint32_t) (getTelemeterDist(TELEMETER_DR) * 10.00), &Font_5x8);
        ssd1306PrintIntAtLine(60, 4, "FR ", (uint32_t) (getTelemeterDist(TELEMETER_FR) * 10.00), &Font_5x8);

        ssd1306Refresh();
    }
    telemetersStop();
}
Exemplo n.º 5
0
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;
}