Exemplo n.º 1
0
void bluetoothTest(void)
{
    int i = 0;
    while (expanderJoyFiltered() != JOY_LEFT)
    {
        bluetoothPrintf("hello ZHONX_III, nb send = %d\r\n", i);
        ssd1306ClearScreen(MAIN_AREA);
        ssd1306DrawStringAtLine(0, 0, "send hello ZHONX III", &Font_5x8);
        ssd1306PrintIntAtLine(0, 1, "nb send = ", i, &Font_5x8);
        ssd1306Refresh();
        i++;
    }
    antiBounceJoystick();
}
Exemplo n.º 2
0
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();
}