-->
Page 1 of 1

digitalWrite HIGH vs LOW

PostPosted: Wed May 31, 2017 5:58 am
by nardev
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);
}

Re: digitalWrite HIGH vs LOW

PostPosted: Thu Jun 01, 2017 5:00 pm
by nardev
i fund out the issue, the buzzer is off only if it is hooked on 3.8 and bigger voltage, where ESP gives onlu about 3.3V during the digital high/low