<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 29 Jan 2023, 23:17 Rhys Sage via Swlug, <<a href="mailto:swlug@mailman.lug.org.uk">swlug@mailman.lug.org.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I was working with my Pi Pico, using Python and it looks awfully like I found a bug in the Pico system. </blockquote></div></div><div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><br></div><div dir="auto">Colin</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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.<br>
<br>
The bug seems to be with GPIO pin assignments.<br>
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:<br>
<br>
from machine import Pin, Timer<br>
import utime<br>
led = Pin(25, Pin.OUT)<br>
buzzer = Pin(15, Pin.OUT)<br>
SkySend = Pin(14, Pin.OUT)<br>
utimer = Timer()<br>
led.value(0)<br>
buzzer.value(0)<br>
SkySend.value(0)<br>
<br>
Then the only place where the pins are addressed is here....<br>
<br>
def LightUp(Time):<br>
led.value(1)<br>
SkySend.value(1)<br>
buzzer.value(1)<br>
utime.sleep(Time)<br>
led.value(0)<br>
SkySend.value(0)<br>
buzzer.value(0)<br>
utime.sleep(InterCharSpace)<br>
<br>
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.<br>
<br>
<a href="https://youtu.be/mAg4ln1TPoY" rel="noreferrer noreferrer" target="_blank">https://youtu.be/mAg4ln1TPoY</a><br>
<br>
<br>
Rhys Sage<br>
<br>
-- <br>
Swlug mailing list<br>
<a href="mailto:Swlug@mailman.lug.org.uk" target="_blank" rel="noreferrer">Swlug@mailman.lug.org.uk</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/swlug" rel="noreferrer noreferrer" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/swlug</a><br>
</blockquote></div></div></div>