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.
main.cpp
- Committer:
- gr91
- Date:
- 2020-11-01
- Revision:
- 1:ed1145480f4b
- Parent:
- 0:d4d44e16e7af
File content as of revision 1:ed1145480f4b:
#include "mbed.h" // // test led rouge et joystick DOWN et affichage sur terminal // GR 2020 // Universite Paris-Saclay - IUT Cachan // // #define TEMPO1 0.5 #define TEMPO2 0.1 Serial pc(USBTX, USBRX); // Nucleo RX : PA_2 ; TX : PA_3 DigitalOut ledr(PB_4); //LED_red Arduino D5 DigitalIn DOWN(PB_0); //joystick down Arduino A3 int main() { float t; pc.printf("LED clignotante deux vitesse \r\n"); ledr=1; while(1) { if(DOWN) t=TEMPO2; else t=TEMPO1; ledr = 0; // OFF wait(t); ledr = 1; // ON wait(t); pc.printf("periode %3.1f \r\n", 2*t); } }