1

I am completely new to RPi and stuck unexpectedly. I am trying to create a simple python program to make my LED blink. Here are the two programs which are giving same outputs on terminal when I checked the status with gpio readall

1.

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
GPIO.setup(4,GPIO.OUT)

for i in range(10):
        print "all good"
        GPIO.output(4,True)
        time.sleep(5)
        GPIO.output(4,False)
        time.sleep(5)


GPIO.cleanup()

2.

from gpiozero import LED
from time import sleep

led = LED(4)
print(led.value)
led.off()
i=0
while i<10:
    print("hi test")
    led.on()
    sleep(1)
    led.off()
    sleep(1)
    i+=1

When I check my LED circuits, it seems all good with 3.3V... however, when I change the pin to any other one LED is not blinking. In fact, nothing is happening.

Please help! Pin: 6 and 7th. The red wire is to ground. Resistor: 560 Ohm!

I am using Pi 1 B+ with raspbian stretch; Python 2.7 and 3.5

circuilt enter image description here enter image description here

Rishi
  • 74
  • 6

1 Answers1

0

In addition to other possible issues, you are using cables with round pins to connect to an IDC connector.

IDC connectors have a flat blade, designed to connect to a square pin.

Using round pins often results in unreliable contacts.

Use proper DuPont connectors to connect to the Pi directly, OR use one of the boards designed for IDC connectors on your breadboard.

Milliways
  • 62,573
  • 32
  • 113
  • 225