#include <stdio.h>
#include <stdlib.h>
void setup() {
// put your setup code here, to run once:
Serial1.begin(115200);
Serial1.println("hello");
}
void loop() {
// put your main code here, to run repeatedly:
delay(1); // this speeds up the simulation
auto button = digitalRead(2);
if (button < 0 || button > 9) {
Serial1.println("bad");
return;
}
char a = '0' + button;
Serial1.println(a);
if (button)
digitalWrite(0, 1);
}