Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 3:3bcd9a1457fa
- Parent:
- 2:d0fbced95564
- Child:
- 4:c35ebfe0669d
--- a/main.cpp Wed Apr 07 15:24:34 2021 +0000
+++ b/main.cpp Wed Apr 07 18:03:48 2021 +0000
@@ -30,8 +30,8 @@
pc.printf("\t Hello World!!! - Здравствуйте Мир!!! - 大家好!!!\n\r");
pc.printf("\n\rWelcome to the world of ADC (A0 and A1) conected to the MH Joystick \n\r- Digital In (PC_13) to Joystick SWitch included\n\r");
-pc.printf("\n\r\t\t\t!!!ATENTION!!! \n\r=> Joystick +5V pin MUST be connected to NUCLEO-F103RB 3V3 pin to avoid damaging NUCLEOs ADC!!!\n\r");
-pc.printf("\n\r%s\t\t\t%s\t\t\t%s\n\r","Eixo X", "Eixo Y", "Tecla SW");
+pc.printf("\n\r\t\t\t\t!!!ATENTION!!! \n\r=> Joystick +5V pin MUST be connected to NUCLEO-F103RB 3V3 pin to avoid damaging NUCLEOs ADC!!!\n\r");
+pc.printf("\n\r%s\t\t\t\t%s\t\t\t\t%s\n\r","Eixo X", "Eixo Y", "Tecla SW");
while(1) {
@@ -45,8 +45,8 @@
x = VRX.read()*255; //Converte uma leitura do ADC em float para formato int e armazena na variável x
y = VRY.read()*255; //Converte uma leitura do ADC em float para formato int e armazena na variável y
- pc.printf("VRX = %1.3fV (%03dh)\t", xv, x);
- pc.printf("VRY = %1.3fV (%03dh)\t", yv, y);
+ pc.printf("VRX = %1.3fV (%03dd - 0x%02Xh)\t", xv, x, x);
+ pc.printf("VRY = %1.3fV (%03dd - 0x%02Xh)\t", yv, y, y);
if (SW == 0) { // Botão usuário pressionado
i++; }