Hi we were asked to program something which when i enter something in the serial monitor it prints Hello world but the catch is it only prints hello world under the conditions that your input in the serial monitor is a 3 bit input and after that i need to have a code which then stops it from printing over and over again. my only problem is that i dontdon't really know how to count the number of bits of an input and also to stop it from printing continuously.
void setup() {
Serial.begin(9600);
}
void loop() {
String readSerial;
String input;
while(Serial.available() > 0){// put your main code here, to run repeatedly:
delay(2);
input.concat(String((char)Serial.read()));
return input;
}
Serial.println("HELLO WORLD");
}