Xinyuan-LilyGO / LilyGO-T-SIM7000G

LilyGO T-SIM7000G
https://pt.aliexpress.com/item/4000542688096.html
284 stars 123 forks source link

Read GPIO input Write GPIO output not working??? #222

Open killerbeat12 opened 1 year ago

killerbeat12 commented 1 year ago

I am trying to read a simple input and write simple output, if have several sensors (light,vibration, buzzer etc) but i don't read any value if i change the vibration or light and also buzzer is not going on?

What extra's do i need to do to activate the inputs and outputs on this board and which one could i use? or are there examples somewhere?

example: i define the GPIO pin

define Buzzer 34

define Vibration 35

setup void setup() { pinMode(Buzzer , INPUT);

// Set Buzzer OFF
pinMode(Buzzer , OUTPUT);
digitalWrite(Buzzer , HIGH);

} void loop() { Serial.println(digitalRead(VIB)); digitalWrite(Buzzer , LOW); }

DevinCarpenter commented 11 months ago

Try googling how to turn a buzzer on and off. Your code should look more like

`int Buzzer = 7; //for Arduino Microcontroller //int Buzzer = D7; //for ESP8266 Microcontroller //int Buzzer = 4; //for ESP32 Microcontroller

void setup(){ pinMode (Buzzer, OUTPUT); }

void loop(){ digitalWrite (Buzzer, HIGH); //turn buzzer on delay(1000); digitalWrite (Buzzer, LOW); //turn buzzer off delay(1000); }`