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.
Diff: main.cpp
- Revision:
- 0:4da94607d8a6
- Child:
- 1:98ee9aaad63b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Apr 16 18:06:16 2019 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" + +AnalogIn analog_value0 ( A0 ); +AnalogIn analog_value1 ( A1 ); +float In[1] = {}; + +int main() { + + + printf(" Leyendo el Joystick \n"); + + while(1) { + + + In[0] = analog_value0.read(); // Converts and read the analog input value (value from 0.0 to 1.0) + printf(" X = %.04f \n", In[0]); + In[1] = analog_value1.read(); // Converts and read the analog input value (value from 0.0 to 1.0) + printf(" Y = %.04f \n", In[1]); + wait (1); + } +}