Arduino LED not blinking - arduino

I am a beginner to ARDUINO. My connections i guess is fine. But LED does not blink. Green and Orange light is blinking on ARDUINO. Anode to pin 13 with 320K resistor and Cathode to ground
Code is as follows
const int LED=13;
void setup()
{
// put your setup code here, to run once:
pinMode(LED,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(LED,HIGH);
delay(1000);
digitalWrite(LED,LOW);
delay(1000);
}

Looks like you plugged one of the legs in ground and one in Another slot.
Check your connections and if it doesn't work, try using another led, and switching the polarities.

The problem here in that you haven't connected anything to pin 13!
Also, a 320K ohm resistor is a little overkill. Usualy, a 220 ohm resistor is enough.
Also, the flat side of the led is the negative side. It is more reliable then if you are following the pins size which isn't always constant.

You need a resistor even if using pin13.
The led in the shield has it's own resistor but if you plug your own you need a resistor.
Take a look at this post:
https://electronics.stackexchange.com/questions/66992/pin-13-do-i-need-a-resistor

hello you can try removing the 320K resistor and replacing it with 220 ohms resistor or directly connec t LED to pin 13 because the onboard resistor is on

Related

Motor shield not moving as expected

Motor shield is not working as expected when connected to battery. When Arduino is connected to USB, motor is moving both FORWARD and BACKWARD, but when connected to battery, it moving only in FORWARD direction. I don't think so it's battery issue, because motor speed is good even it moves only in FORWARD direction.
Below is the code,
#include <AFMotor.h>
AF_DCMotor motor1(1);
AF_DCMotor motor2(2);
void setup() {
Serial.begin(9600);
Serial.println("Motor");
motor1.setSpeed(254);
motor2.setSpeed(254);
motor1.run(RELEASE);
motor2.run(RELEASE);
}
void loop() {
motor1.run(BACKWARD);
motor2.run(BACKWARD);
delay(500);
motor1.run(FORWARD);
motor2.run(FORWARD);
delay(500);
}
Well, it should work with your above code. But note that there is a jumper on the shield that you have to remove in order to power it through the battery.
Requires a little power trigger or if we wait for around 2-3 minutes the motor works good. Motor shield drains the battery often. Seems to be it requires more power supply. Power supply from USB cable works perfectly rather than batteries

Particle Photon, controlling a PCF8574 via I2C- works on Arduino

I'm trying to read and control some buttons and LEDs on a Bang & Olufsen infrared eye. It uses a pcf8574 microcontroller to control 2 LEDs and 4 buttons. First of all I just want to get the LEDs to blink. I have successfully done that with an Arduino Uno.
But I want to use it with an Particle Photon so I can connected to the internet. Here I have the code that worked on the Arduino:
#include <Wire.h>
#define beolink (B0100000)
void setup() {
Wire.begin();
}
void loop() {
Wire.beginTransmission(beolink);
Wire.write(0b11111111);
Wire.endTransmission();
delay(1000);
Wire.beginTransmission(beolink);
Wire.write(0b00111111);
Wire.endTransmission();
delay(1000);
}
I have no errors on the Particle Photon. I have also tried switching cables and tried 5v instead of the 3.3v. I have connected the pins on the Particle Photon to the same as on the Arduino [SCL(D1) & SDA(D0)].
Thanks to this guy: https://community.particle.io/u/scruffr/summary
It now works. It was not a problem with the code. Apparently you need 2 pull-up resistors on the I2C pins on a Particle Photon. thank you

I set my pushbutton switch up incorrectly

I am fiddling with an Arduino Uno and trying to get two switches to operate two servo motors. I am not able to do this right now, and I am not sure what my issue is. I know that my servos are wired correctly; however, I highly doubt that my switches are correctly wired.
Here is a diagram of my circuit and the code that I am using.
#include <Servo.h>
Servo servo_11;
Servo servo_10;
void setup()
{
servo_11.attach(11);
servo_10.attach(10);
pinMode(A3, OUTPUT);
pinMode(A2, OUTPUT);
pinMode(A2, INPUT);
}
void loop()
{
servo_11.write(0);
servo_10.write(0);
digitalWrite(A3, LOW);
digitalWrite(A2, LOW);
if (analogRead(A2) != LOW) {
servo_11.write(180);
}
delay(10);
}
Circuit image
If anyone could point out what's wrong, I would really appreciate it!!
You have floating inputs. When the button isn't pressed the pin isn't connected to anything. So the pin can read whatever noise it happens to pick up from the environment. You need pull-down or pull-up resistors. If you use pull-ups, then you can use the ones built into the chip.
You also seem to be confusing analogRead and digitalRead. It's digitalRead that gets HIGH and LOW. analogRead gets values from 0 to 1023 for 0 to 5V.
pull-down resistor circuit
try looking on this to understand the concept
it makes sure that when you dont press the pin will read ground and only when it presses the button you make voltage divider that ups the volage to a non-zero to give you HIGH

Pins that I used in LCD are not working as OUTPUT for LED

I am running out of pins. I used the pin that I use in LCD as output for a LED however the led is not turning off its always even my code is like this
void setup() {
lcd.begin(20, 4);
pinMode(7 , OUTPUT);
digitalWrite(7, low);
}
Plug off the LCD for a while to see whether your led blinking program is correct.
Anyway, you can't use the same pin for different functions, it's good chance that they will
disturb each other (say, the led will flash silly when you send something to the LCD),
kick out each other (as we see it in your case).

Arduino 16x2 LCD Stays Blank

I am using an Arduino Mega with a 16x2 LCD. When I start the Arduino the LCD flashes white and sometimes random lines will show up and gradually fade out. The backlight is on, however, so the LCD is not inverted. At first I thought the Arduino was not getting enough power because I am using a Raspberry Pi to program it, but plugging in a 6V battery pack did not change the result. I tried plugging in a different 16x2 LCD to check if the one I was using is broken, but again, the result was the same. I have triple-checked my connections, adjusted the potentiometer, and fiddled around with where the LCD was connected on the breadboard in case some of the pins were broken, but to no avail.
Does the LCD have a problem with Arduino Mega boards? Or am I just unfortunate enough to have two broken LCDs?
Code:
#include <LiquidCrystal.h>
#define led_pin 22
#define buzzer_pin 7
LiquidCrystal lcd(12,11,5,4,3,2);
void setup() {
pinMode(led_pin, OUTPUT);
pinMode(buzzer_pin, OUTPUT);
lcd.begin(16,2);
digitalWrite(led_pin, HIGH);
tone(buzzer_pin, 1000, 500);
delay(500);
digitalWrite(led_pin, LOW);
lcd.print("LCD Test");
}
void loop() {
}
EDIT
I moved the LCD and wiring back to the other side of the breadboard and it did not change the output. I'm starting the think that the LCDs are just simply broken because the LCDs will randomly flash and fade unevenly. I found that these LCDs can be easily fried by incorrectly adjusting the potentiometer.
Make sure that you solder headers to the lcd, then press the headers into your breadboard and connect to arduino with jumper wires. Just resting the LCD on the headers without solder or jabbing the lcd pin holes with jumper wires don't make reliable connections. You WILL see random stuff
Make sure you connect the LCD correctly. If you did, you wouldn't have got any problems. Post a picture.
Make sure the pins you used in the code match pins you connected to the LCD.
Best way to get arduino help is on arduino forum.
Specifically which LCD are you using?
Do you have datasheets for the exact LCD you are using so you can confirm you have the correct wiring and supply voltages?
If you still have no luck, you may want to try a LCD module that has a serial, i2c, or spi interface.
They are much easier to use than HD44780 parallel modules (im assuming this is what you have).
An example source of such modules is https://www.crystalfontz.com/c/character-lcd-displays/interface/24

Resources