digitalWrite HIGH vs LOW
Posted: Wed May 31, 2017 5:58 am
I try this example with arduino and it works perfectly, when i send LOW the device i have starts buzzer and when i send HIGH it stops it.
How ever, when i adjust pin number and compile and upload the same sketch on ESP8266 (nodemcu) it simply starts buzzing always with tinny difference according to delay in the sketch.
p.s. tone() didn't work on arduino too and the device is completely closed i cant see what is inside, i only know what wire to use to hook the buzzer to arduino/nodemcu.
#define BUZZER_PIN 8
void setup() {
pinMode(BUZZER_PIN, OUTPUT);
digitalWrite(BUZZER_PIN, HIGH);
}
void loop() {
digitalWrite(BUZZER_PIN, LOW);
delay(500);
digitalWrite(BUZZER_PIN, HIGH);
delay(500);
}
How ever, when i adjust pin number and compile and upload the same sketch on ESP8266 (nodemcu) it simply starts buzzing always with tinny difference according to delay in the sketch.
p.s. tone() didn't work on arduino too and the device is completely closed i cant see what is inside, i only know what wire to use to hook the buzzer to arduino/nodemcu.
#define BUZZER_PIN 8
void setup() {
pinMode(BUZZER_PIN, OUTPUT);
digitalWrite(BUZZER_PIN, HIGH);
}
void loop() {
digitalWrite(BUZZER_PIN, LOW);
delay(500);
digitalWrite(BUZZER_PIN, HIGH);
delay(500);
}