Go to advanced search

by 2wheelz4me
Fri Aug 30, 2019 10:26 pm
Forum: Beginners
Topic: Need help please - Python push button code
Replies: 21
Views: 1029

Re: Need help please - Python push button code

Finally got it! I went and picked up new button's and it works like a champ now. For whatever reason, both my buttons were defective. All set and again, really appreciate the help from everyone!!
by 2wheelz4me
Fri Aug 30, 2019 7:11 pm
Forum: Beginners
Topic: Need help please - Python push button code
Replies: 21
Views: 1029

Re: Need help please - Python push button code

So when I ran the code nielgl provided nothing happens other than the blinking led. So i did the button tests provided and it appears maybe both my buttons are defective as nothing happens on any of the tests. I'll try to find a button somewhere and re-try. Hopefully that fixes things. Thanks so muc...
by 2wheelz4me
Fri Aug 30, 2019 3:59 pm
Forum: Beginners
Topic: Need help please - Python push button code
Replies: 21
Views: 1029

Re: Need help please - Python push button code

The code below works with no errors but the LED will not change from blinking to solid when I press the button: import RPi.GPIO as GPIO import time ledPin = 8 butPin = 22 GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) GPIO.setup(ledPin, GPIO.OUT) GPIO.setup(butPin, GPIO.IN, pull_up_down=GPIO.PUD_U...
by 2wheelz4me
Fri Aug 30, 2019 3:46 pm
Forum: Beginners
Topic: Need help please - Python push button code
Replies: 21
Views: 1029

Re: Need help please - Python push button code

I tried this latest suggestion and it did not work. The LED is sold but no blink with button pushed or not pushed. Here is my full code and the error is below that. import RPi.GPIO as GPIO import time from gpiozero import LED, Button from signal import pause ledPin = 8 butPin = 22 GPIO.setwarnings(F...
by 2wheelz4me
Fri Aug 30, 2019 3:29 pm
Forum: Beginners
Topic: Need help please - Python push button code
Replies: 21
Views: 1029

Re: Need help please - Python push button code

Thank you! Actually trying to: LED to blink when a push button is NOT pressed. However, the LED should stay on continually when the push button IS pressed. I am not getting any error messages and the LED does blink when I run the code but when I press the button it does not stay solid and simply con...
by 2wheelz4me
Fri Aug 30, 2019 1:33 pm
Forum: Beginners
Topic: Need help please - Python push button code
Replies: 21
Views: 1029

Re: Need help please - Python push button code

Understood on typing the code by hand however i do not have WiFi setup so i cannot send or share the actual code. Again the code is working with no errors, its simply not responding to the button.

Thanks again!
by 2wheelz4me
Fri Aug 30, 2019 2:58 am
Forum: Beginners
Topic: Need help please - Python push button code
Replies: 21
Views: 1029

Re: Need help please - Python push button code

So I edited the PIN’s slightly and again the LED flashes but does not remain solid when I push the button. Actually pushing the button does nothing. Here is the new code. No errors, just does not remain solid when pushing the button. import PRI.GPIO as GPIO Import time Ledpin = 8 # L in LedPin is no...
by 2wheelz4me
Fri Aug 30, 2019 1:37 am
Forum: Beginners
Topic: Need help please - Python push button code
Replies: 21
Views: 1029

Re: Need help please - Python push button code

That’s correct. LED is 12 and the button is on 22.
by 2wheelz4me
Thu Aug 29, 2019 10:42 pm
Forum: Beginners
Topic: Need help please - Python push button code
Replies: 21
Views: 1029

Re: Need help please - Python push button code

I cannot thank you guys enough! So the code does not have errors and when connected the LED blinks. What it is not doing is interacting with the button. I do have the bottom on board pin 22 and the LED on board pin 12. Thoughts? There were a couple comments that the PIN was not on 22 but I have coun...
by 2wheelz4me
Thu Aug 29, 2019 2:09 am
Forum: Beginners
Topic: Need help please - Python push button code
Replies: 21
Views: 1029

Need help please - Python push button code

Hi all- I am brand new to Raspberry Pi and Python. I have an assignment I am working on and cannot get it to work. Any help would be greatly appreciated!! The task is: "Build a circuit using your Raspberry Pi that causes an LED to blink when a push button is NOT pressed. However, the LED should stay...

Go to advanced search