Go to advanced search

by baby y0sh
Thu Jul 02, 2020 1:43 am
Forum: Beginners
Topic: Yet another question about LEDs and resistors...
Replies: 7
Views: 238

Re: Yet another question about LEDs and resistors...

I see - so there is a voltage range dependent on current. Just one question: For the above LED, what resistor should I use... or rather, what Vf should I use to calculate the appropriate resistor strength?
by baby y0sh
Thu Jul 02, 2020 12:53 am
Forum: Beginners
Topic: Yet another question about LEDs and resistors...
Replies: 7
Views: 238

Re: Yet another question about LEDs and resistors...

The example table? I am not sure how that answers my question. Not that it doesn't - i just still do not understand.
by baby y0sh
Wed Jul 01, 2020 10:21 pm
Forum: Beginners
Topic: Yet another question about LEDs and resistors...
Replies: 7
Views: 238

Yet another question about LEDs and resistors...

Okay - so, I have a specific question about my new setup. I am making a simple halloween pumpkin as my first project, which involves a RPi Zero controlling 2 yellow LEDs and 1 orange LED. I set it all up and it works great using the 220 ohm resistors that came with my Pi. Now that I am diving into b...
by baby y0sh
Sat Jun 27, 2020 2:28 am
Forum: Python
Topic: gpiozero button problem with is_held
Replies: 18
Views: 621

Re: gpiozero button problem with is_held

Answered my own question. Apparently daemon wasn't added to arguments until python 3.3. It works fine now - I took it out of the arguments parens and put loop_thread.daemon = True before the .start(). However, this has me wondering: should I be upgrading pythons as they come out? I downloaded to lat...
by baby y0sh
Fri Jun 26, 2020 11:47 pm
Forum: Python
Topic: gpiozero button problem with is_held
Replies: 18
Views: 621

Re: gpiozero button problem with is_held

Okay - hopefully last question. This works beautifully when run from the python program on my RPi, however, absolutely freaks out when I try to run it from the terminal. I do not understand why that would be. Do you know why this is and what I can do to fix it?
by baby y0sh
Fri Jun 26, 2020 10:40 pm
Forum: Python
Topic: gpiozero button problem with is_held
Replies: 18
Views: 621

Re: gpiozero button problem with is_held

oh. your. god.
YES! This is it - thank you! So, being new to coding, I guess i just expected things to run in the background for whatever reason, but threading/multiprocessing is exactly what I was looking for. Thank you for your patience and all your help!
by baby y0sh
Mon Jun 22, 2020 9:53 pm
Forum: Python
Topic: gpiozero button problem with is_held
Replies: 18
Views: 621

Re: gpiozero button problem with is_held

Are you saying you tested the 2 GPIO/1 Button method? I have not gotten it to work. I've gone as far as making 2 buttons with 2 GPIO - I have accomplished setting a blinking LED light with one button press to be conditional on a steady LED light toggled with another button when held, however, revers...
by baby y0sh
Mon Jun 22, 2020 12:25 am
Forum: Python
Topic: gpiozero button problem with is_held
Replies: 18
Views: 621

Re: gpiozero button problem with is_held

That's a negative - while loop soldiers on. I suppose, if I get the script to auto-launch on startup, I could just use the power button as the on/off. Huge defeat for me on my first project, but I guess it'd work :/
by baby y0sh
Sun Jun 21, 2020 3:00 am
Forum: Python
Topic: gpiozero button problem with is_held
Replies: 18
Views: 621

Re: gpiozero button problem with is_held

That's okay - I am just looking to make it so I plug in the Pi Zero and it boots up the script (cause I wont have a monitor hooked up when its in the pumpkin), which can be controlled by a button. The above script does not work, btw. I am not sure why - if I followed your logic correctly with the us...
by baby y0sh
Fri Jun 19, 2020 9:44 pm
Forum: Python
Topic: gpiozero button problem with is_held
Replies: 18
Views: 621

Re: gpiozero button problem with is_held

Thank you! I'm at work now, but will give that a go next time I'm near my RPi. I was thinking the below might work as well with the one button - will test and see! from gpiozero import LED, Button from time import sleep from signal import pause led = PWMLED(24) button = Button(2) running = False def...
by baby y0sh
Fri Jun 19, 2020 1:13 am
Forum: Python
Topic: gpiozero button problem with is_held
Replies: 18
Views: 621

Re: gpiozero button problem with is_held

Thank you for your reply! Global variables are new to me, but I believe I have a handle on them now. I took your advice and set up a test code for the button and an LED light, shown below. I included some of my reasoning, as I am really wanting to understand what is going on in the code. The example...
by baby y0sh
Wed Jun 17, 2020 12:27 am
Forum: Python
Topic: gpiozero button problem with is_held
Replies: 18
Views: 621

Re: gpiozero button problem with is_held

Hmmm - I didn't think about the ramifications of multiple button presses. Yes, I am trying to get the button to fire it up once (with multiple presses having no effect) and then that same button (held instead of pressed) to stop everything, but reset so that an additional press would fire it off aga...
by baby y0sh
Tue Jun 16, 2020 1:05 am
Forum: Python
Topic: gpiozero button problem with is_held
Replies: 18
Views: 621

gpiozero button problem with is_held

Hello! I am making a pumpkin pi for Halloween - just now integrated the button and am having trouble with the "is_held" bit in order to turn it off. It consists of 4 LED lights. 1 yellow flicker, 1 yellow "breathing", 1 orange steady, and 1 red - the first 3 fade out while the red one fades in, then...

Go to advanced search