I've just joined this group and so this is my first question. I've been an Arduino user on and off (lots of off time) since the Duemilanove board first became available and I'm still using it. I have browsed questions relating to wokwi.
I see that serial.writes show up in the wokwi serial monitor but is it possible to enter serial.reads? If so where do I enter the bytes to be read?
int incomingByte;
void setup() {
Serial.begin(9600); // Set baud rate
}
void loop() {
if (Serial.available() > 0) { // Check if data is available
incomingByte = Serial.read(); // Read the byte
Serial.print("You sent: "); // Print a message
Serial.println(incomingByte); // Print the received byte
delay(1000);
}
}
void setup() {
Serial.begin(9600); // Set baud rate
Serial.print("showing serial screen"); // Print a message
}
void loop() {
if (Serial.available() > 0) { // Check if data is available
byte incomingByte = Serial.read(); // Read the byte
Serial.write(incomingByte); // Print the received byte
//delay(10);
}
}
Thank you alto777. I had already tried adding that to the .jason file but it showed as an error. I'll look at it again. The serial monitor did start by itself anyway so maybe adding to the .jason file is unnecessary. I had played with the serial plotter, using a different sketch, and it worked as well.