analogWrite is a lie

master
ugrnm 5 years ago
parent 47b7823ca2
commit f3dc42b46f

@ -17,7 +17,6 @@
float delay_on; float delay_on;
float delay_off; float delay_off;
float delay_div;
void setup() { void setup() {
// initialize the digital pin as an output. // initialize the digital pin as an output.
@ -40,9 +39,9 @@ void loop() {
// Parameters for the PWM // Parameters for the PWM
digitalWrite(LED, HIGH); // turn the LED on digitalWrite(LED, HIGH); // turn the LED on
analogWrite(SPEAKER, 255); // set max audio signal digitalWrite(SPEAKER, HIGH); // set max audio signal
delay(delay_on); // wait for delay_on ms delay(delay_on); // wait for delay_on ms
digitalWrite(LED, LOW); // turn the LED off digitalWrite(LED, LOW); // turn the LED off
analogWrite(SPEAKER, 0); // audio flat line digitalWrite(SPEAKER, LOW); // audio flat line
delay(delay_off); // wait for delay_off ms delay(delay_off); // wait for delay_off ms
} }

Loading…
Cancel
Save