I have this code which produces a square wave:
int output_state = 0;
unsigned long start;
void setup() {
Serial.begin(1200);
start = millis();
}
void loop() {
if((millis() - start) >=1000){
output_state = ! output_state;
//output_state *= 1023;
start = millis();
}
Serial.println(output_state);
}
but should I multiply the signal by 1023:
output_state *= 1023;
this signal is produced by the Serial Plotter:
Mind that the timing is right, just the x axis speeds up in zero values. Why is that happening, and how can be solved?
Any thoughts would be appreciated.

