How to simulate this kind of code ?
bool bp_on;
void setup() {
pinMode(3, INPUT);
}
void loop() {
bp_on = digitalRead(3);
}
Currently, it just displays:
pinMode pin 3 set to : INPU
pinMode pin 4 set to : INPU
But no interaction possible to simulate button pressed.
By the way, typo at https://github.com/marcmerlin/ArduinoOnPc-FastLED-GFX-LEDMatrix/blob/master/src/cores/arduino/wiring_digital.cpp#L19 should be INPUT (no INPU).
Full ino code:
bool bp_on; // variable associee au bouton poussoire on
bool bp_off; // variable associee au bouton poussoire off
enum Etat { MARCHE, ARRET }; // Declaration des etats possibles
Etat etatCourant; // variable associee à l'etat courant
void setup()
{
pinMode(3, INPUT); // La pin 3 est definie comme une entree (bouton poussoire)
pinMode(4, INPUT); // La pin 4 est definie comme une entree (bouton poussoire)
etatCourant = MARCHE; // Etat initial
}
void loop()
{
// Mise a jour des entrees
bp_on = digitalRead(3);
bp_off = digitalRead(4);
// Gestion de l'evolution des etats
switch (etatCourant)
{
case MARCHE:
// Action etat Marche
//...
// Transition vers l'etat ARRET
if (bp_off) {
etatCourant = ARRET;
}
break;
case ARRET :
// Action etat Arret
//...
//Transition vers l'etat MARCHE
if (bp_on) {
etatCourant = MARCHE;
}
break;
}
}
How to simulate this kind of code ?
Currently, it just displays:
But no interaction possible to simulate button pressed.
By the way, typo at https://github.com/marcmerlin/ArduinoOnPc-FastLED-GFX-LEDMatrix/blob/master/src/cores/arduino/wiring_digital.cpp#L19 should be INPUT (no INPU).
Full ino code: