I am trying to edit the above code (triangular wave with 2.6- second rising edge and 2.6-second duration falling edge) so that it produces a sawtooth wave with 20-ms duration in rising edge and 2.6-second duration in falling edge. I am not sure where to even start with this as I am new to Arduino. Thank you!
Hello
Add Serial.println(i) to monitor the wave form by using the serial plotter function of the IDE and LedPin 13 isn´t a PWM output at the Arduino UNO.
Have a nice day and enjoy coding in C++.
Дайте миру шанс!
So 256 steps with 10 millisecond delay take 2600 milliseconds. 2600 - 2560 = 40 milliseconds. I think if you remove the delay completely you will get about 40 milliseconds for your rising edge. Try removing the delay AND changing "i++" to "i += 2". That should get you close to 20 milliseconds