start:arduino:cours:vittascience
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| start:arduino:cours:vittascience [2025/12/14 14:30] – [Televerser dans le robot mBot1 à partir de l'interface Vittascience] admin | start:arduino:cours:vittascience [2026/03/08 11:25] (Version actuelle) – [Mot de passe avec telecommande] admin | ||
|---|---|---|---|
| Ligne 268: | Ligne 268: | ||
| mBot_setMotorLeft(0, | mBot_setMotorLeft(0, | ||
| } | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Mot de passe avec telecommande ==== | ||
| + | |||
| + | < | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | |||
| + | <code c mdp_robot.ino> | ||
| + | #include < | ||
| + | #include < | ||
| + | #include < | ||
| + | #include < | ||
| + | |||
| + | MeRGBLed rgbled_board(7, | ||
| + | MeIR ir; | ||
| + | |||
| + | void serial_setupConnection(long baudrate) { | ||
| + | Serial.begin(baudrate); | ||
| + | while (!Serial) { | ||
| + | Serial.println(" | ||
| + | delay(1000); | ||
| + | } | ||
| + | Serial.println(" | ||
| + | delay(50); | ||
| + | } | ||
| + | |||
| + | |||
| + | void setup() { | ||
| + | ir.begin(); | ||
| + | serial_setupConnection(9600); | ||
| + | rgbled_board.setColor(0, | ||
| + | rgbled_board.show(); | ||
| + | while (!(ir.keyPressed(12))) { | ||
| + | } | ||
| + | while (!(ir.keyPressed(24))) { | ||
| + | } | ||
| + | while (!(ir.keyPressed(94))) { | ||
| + | } | ||
| + | rgbled_board.setColor(0, | ||
| + | rgbled_board.show(); | ||
| + | Serial.println(" | ||
| + | Serial.println(" | ||
| + | delay(1000*1); | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| } | } | ||
| </ | </ | ||
/home/chanteri/www/fablab37110/data/attic/start/arduino/cours/vittascience.1765719010.txt.gz · Dernière modification : de admin
