[Swlug] Have I found a bug?
Rhys Sage
rhys_sage at yahoo.com
Sun Jan 29 23:15:47 UTC 2023
I was working with my Pi Pico, using Python and it looks awfully like I found a bug in the Pico system. Whether that will go away if I code in C++ I don't know. Meanwhile I have an Adafruit Arduino Metro to play with. That seems to take only C++ which is not what I would have preferred but I can still use it.
The bug seems to be with GPIO pin assignments.
Pin 25 is the onboard LED. Pins 14 and 16 are being used as ordinary pins though I'm in reality not touching pin 16. I have a pin assignment like this:
from machine import Pin, Timer
import utime
led = Pin(25, Pin.OUT)
buzzer = Pin(15, Pin.OUT)
SkySend = Pin(14, Pin.OUT)
utimer = Timer()
led.value(0)
buzzer.value(0)
SkySend.value(0)
Then the only place where the pins are addressed is here....
def LightUp(Time):
led.value(1)
SkySend.value(1)
buzzer.value(1)
utime.sleep(Time)
led.value(0)
SkySend.value(0)
buzzer.value(0)
utime.sleep(InterCharSpace)
What's happening is that led and SkySend are doing opposite things. When led is on, SkySend is off. When led is off, SkySend is on. That makes no sense whatsoever because LightUp switches them on and off. It would seem logical just to flip SkySend but it doesn't seem to work well like that. This is all very strange. Here's a video I shot of the Raspberry Pi lighting. The little white LED lamp does indeed go dim to bright - probably because I need to replace the 2K resistor with 68K.
https://youtu.be/mAg4ln1TPoY
Rhys Sage
More information about the Swlug
mailing list