简体   繁体   中英

how to connect an ac bulb with arduino

I have a really big problem when I connect a bulb with an Arduino using a relay module that the code flows inside the Arduino uno then I don't know what happens and nothing appear on the lamp or the relay and I am kind a bit sure about the connection by the jumper wires and I checked the lamp if it's working or not and it was working so that doesn't make sense and I want an answer for this question.

  1. Did you check if the output signal working or not?(Try to print in console as well to check if your logic is working properly.)
  2. Check if you have configured output pins properly.
  3. Change the output pin and check again.
  4. Check if you have configured everything properly.

check this out----> https://www.arduino.cc/reference/en/language/functions/digital-io/digitalwrite/

This is sample program which turns on and off an output pin.

void setup() {
  pinMode(13, OUTPUT);    // sets the digital pin 13 as output
}

void loop() {
  digitalWrite(13, HIGH); // sets the digital pin 13 on
  delay(1000);            // waits for a second
  digitalWrite(13, LOW);  // sets the digital pin 13 off
  delay(1000);            // waits for a second
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM