Give me a mini coding problem involving while loops.
Im a beginner and wanna learn while loops better. thanks
6 Replies
print out - on serial a list of numbers ranging from 0 to 300 jumping 10 each time
eg
Hmmm
š¶ yeah editted
I was trying to think of other things too.
int counter = 0;
int delay2 = 200;
void setup(){
Serial.begin(9600);
} void loop() { while(counter<=300) { Serial.println(counter); delay(delay2); counter=counter + 10; } } I got it from 10 to 300 im not sure how to make it from 0 to 300 also I used for loops to do the same thing and it was a lot easier for me. Should I just use for loops more? what the is that I wonder
} void loop() { while(counter<=300) { Serial.println(counter); delay(delay2); counter=counter + 10; } } I got it from 10 to 300 im not sure how to make it from 0 to 300 also I used for loops to do the same thing and it was a lot easier for me. Should I just use for loops more? what the is that I wonder
@TheStudier Wokwi - a simulator for arduino allowing you to test code etc and show others.
A basic search of the term wokwi would have told you that
i think OP was referring to
application.cpp
or the Fibonacci-like sequenceOk - so here I sit broken hearted...
š
thanks guys