[Swlug] Have I found a bug?

Colin Law clanlaw at gmail.com
Mon Jan 30 07:45:03 UTC 2023


On Sun, 29 Jan 2023, 23:17 Rhys Sage via Swlug, <swlug at mailman.lug.org.uk>
wrote:

> I was working with my Pi Pico, using Python and it looks awfully like I
> found a bug in the Pico system.


I don't know the details of the device, but are you sure it is not just
that your assumption about the pins is not right. If they are active pull
down, then a value of 1 may cause the output to pull down to 0v, and a
value of 0 allows it to float high. In terms of the led, a value of 1 may
pull it down, but this may switch the led on.

Colin





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
>
> --
> Swlug mailing list
> Swlug at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/swlug
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/swlug/attachments/20230130/d0585e5c/attachment.htm>


More information about the Swlug mailing list