Raspberry Pi Pico -...
 
Notifications
Clear all

Raspberry Pi Pico - Control the (I/O) World

72 Posts
21 Users
40 Likes
11.5 K Views
(@underwood-41)
Member
Joined: 3 years ago
Posts: 2
 
Posted by: @jfabernathy
Posted by: @jfabernathy
Posted by: @larrytubbs

I’ve used GPIO 15 on the Pi Pico without issue. I don’t see anything in the data sheet about it being special. The extra GPIO that I know of is the onboard LED. It has no paired external PIN. I believe it is GPIO 25. This looks like a typo to me. Given the pins start counting at zero, they must be referring to this pin, it is the 26th.

I put a question in the Adafruit forum.  We'll see what I get back.

 

It appears that the pin issue is related to beta releases of CircuitPython.  For details see: 

https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython/faq-and-troubleshooting#should-i-use-pin-gp15-3082470-3

Many thanks for solving this!

Kindest Regards, 

Willie 


   
ReplyQuote
 DEC
(@dec)
Member
Joined: 3 years ago
Posts: 2
 

Bill,

Thanks for yet another excellent educational video.

Using Micropython is there any way to increase the text size on the OLED display?

Thanks,

Dec


   
ReplyQuote
(@jfabernathy)
Member
Joined: 3 years ago
Posts: 141
 

For those of you that wonder about the differences between using CircuitPython vs. MicroPython, it comes down to using the libraries. The names of the libraries can be different and the way they handle passing values. MP seems to use a lot of functions while CP use Class attributes.  As an example I converted one of Bill's sketches from MP to CP. It's different; almost every line was touched.  That's why once you've spent time with CP, it's hard to use MP.  I use a lot of Adafruit Stemma QT breakout boards for sensors, displays, etc.  So I use their libraries which mean MP might not use the same library or call syntax. 

The big advantage for me is the same CP program I write for the Pico using I2C sensors will work unchanged on the Raspberry Pi 4 using the Adafruit Blinka library which is compatible with the CP library.

If your code won't compile, have another glass of bourbon. Eventual the problem will be solved.


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1112
 
Posted by: @jfabernathy

For those of you that wonder about the differences between using CircuitPython vs. MicroPython

you make a very good point about blinka.

For me CircuitPython has probably gone a bit overboard in making life simple for the user, and as you say in a previous post, their libraries are quite large chunks of code, not alway the simplest to read and one seemly simple library calls yet another library that imports yet another..... Quite a chain of libraries in fact.

But nevertheless I do use the Adafruit libraries and choose to run CircuitPython sometimes.  I have used blinka on my rpi on occasions. It works well. This is a topic that I'm sure @dronebot-workshop will eventually bring forth in his articles to come.

However, I have also found the MicroPython machine.i2c is quite similar to the SMBus rpi library for minimal code changes from microprocessor to rpi. when using i2c and much bloat can be saved. Also CircuitPython cannot handle interrupts, threading and no asyncio scheduler, at least at present.

One thing to be aware of is that each MicroPython port may be different. The 'original' MicroPython code is created for the pyboard, and I think that ports for the ESP8266, ESP32 and the rpi Pico and the BBC microbit are maintained by separate folks and can have differences in their provided libraries. But they all follow on from the code updated made to the pyboards' MicroPython updates and the core to all is still very much the same. For the boards that CircuitPython support, whilst the various board may have different bits of the base CircuitPython implemented, it endeavours to keep the bits that are implemented standard across the platforms it seems.


   
ReplyQuote
(@jfabernathy)
Member
Joined: 3 years ago
Posts: 141
 

Anyway, I'm back to doing the demos from the video and when I got to the motor I only have a L293D which came in a box of parts kit with a little DC motor.  I've used that with the Raspberry Pi to run some demos.  Would that work okay with Bill's code? Maybe different wiring but I'm hoping I can just use what I have.

 

If your code won't compile, have another glass of bourbon. Eventual the problem will be solved.


   
ReplyQuote
(@jfabernathy)
Member
Joined: 3 years ago
Posts: 141
 
Posted by: @jfabernathy

Anyway, I'm back to doing the demos from the video and when I got to the motor I only have a L293D which came in a box of parts kit with a little DC motor.  I've used that with the Raspberry Pi to run some demos.  Would that work okay with Bill's code? Maybe different wiring but I'm hoping I can just use what I have.

 

I compared my demo program for the L293D motor controller and it was basically the same as Bill's as far as PWMing the enable pins on the controller and setting the drivers to the opposite polarity.  So Bill's code worked without modification. 

In fact the only real change I made to any of the demos was the OLED program because my display was 128 x 64 instead of 128 x 32. 

So not that I have 4 or 5 programs on the Pico stored there. How do I delete them???

If your code won't compile, have another glass of bourbon. Eventual the problem will be solved.


   
ReplyQuote
 Bart
(@bart)
Member
Joined: 3 years ago
Posts: 1
 

Did anyone try to replicate the example https://dronebotworkshop.com/pi-pico/#Adding_a_Display ?

I did, and got an error: ImportError: can't import name SSD1306_I2C . It seems to me that I did not install the correct library. I noticed, when I installed the library, that the installer said 'Package is not available at micropython.org. Version at PyPI will be installed.  Suggestions anyone?

Regards,

Bart


   
Smurf and KenB reacted
ReplyQuote
(@oceanchild67)
Member
Joined: 4 years ago
Posts: 4
 

@dronebot-workshop

I will look forward to that, your explanations on such topics will enable me to see how you trouble shoot and make the new replacement libraries function.

Off topic - I have (thanks to your detailed videos) made many projects in my home and in others using the ATMEGA328P. What I am trying to find is how I integrative  a CH340G chip (have 10 of them) and have that on the board along with the ATMEGA to make it simple to just attach the usb lead to a socket and upload etc... a) Is this possible? & b) would this be something you could assist with? I have looked on the net but nothing seems to be dedicated just to achieve this without the use of an FTDI adaptor etc?

Thanks in advance...

Davie


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1112
 
Posted by: @jfabernathy

So not that I have 4 or 5 programs on the Pico stored there. How do I delete them???

That was from your post some time back and I guess you have solved your deletions by now, but the use of Thonny or rshell is the solution.  For a good explanation see the following link:

https://www.mfitzp.com/article/using-micropython-raspberry-pico/


   
ReplyQuote
(@jfabernathy)
Member
Joined: 3 years ago
Posts: 141
 

I'm sorry I forgot to update this thread with the answer I got over on the Raspberry Pi forum:

https://www.raspberrypi.org/forums/viewtopic.php?f=144&t=304992

If your code won't compile, have another glass of bourbon. Eventual the problem will be solved.


   
ReplyQuote
(@videogame95)
Member
Joined: 3 years ago
Posts: 38
 

Hi I'm new to micro control boards and I would like to know which programme editer to use with which programme 

ie:  Circuit python works with mu, IDE works with adafruit libraries  What does Thonny work with? Can anyone make a YouTube vid on all three editors thanks

 

 

This post was modified 3 years ago by videogame95

   
ReplyQuote
DeadlyDave
(@deadlydave)
Member
Joined: 3 years ago
Posts: 6
 

Hi All,

First post here (well aside from the introduce yourself post)

I'm looking for a little help from anyone willing to offer it.
I'm working on my Pico with MicroPython.

I have managed to blink the R,G & B LED's, make the buttons work and make the POT dim and brighten another LED. (Following the video tutorial)
I then went onto try an OLED (0.91" SSD1306 OLED Display 128 * 32)
I sure I have it wired up correctly but that is not where my issue is anyway.

My problem seems to be installing new libraries.
I went to 'tools' and 'Manage Packages' and searched for SSD1306 and tried to install the library but I got the following error msg. (It doesn't seem to matter which library I try to install I always get the same error)

"Installing to: C:\Users\<Username>\AppData\Local\Temp\tmpvzwv1kb7\
micropip returned with error code 1"

Any help would be greatly appreciated.


   
Smurf and Sean451 reacted
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1112
 

@deadlydave

copy and paste the ssd1306.py file from github:

https://github.com/micropython/micropython/blob/master/drivers/display/ssd1306.py

to you rpi pico and you should then be good to go - i.e. import ssd1306 😀 


   
DeadlyDave and Sean451 reacted
ReplyQuote
DeadlyDave
(@deadlydave)
Member
Joined: 3 years ago
Posts: 6
 

 

error

Hey Byron,

 

Thanks a million for the reply.

I gave that a shot, I tried both 'import SSD1306' & 'from SSD1306 import SSD1306_I2C' after pasting the ssd1306.py file (from the link you sent, thanks again) on to the Pico.

When I try to run the file, it still doesn't seem to be able to see the class for some reason. Sorry I feel like I am being a numpty here.

I get the following error (shown in the image below)

Traceback (most recent call last):
File "<stdin>", line 3, in <module>
ImportError: no module named 'SSD1306'

 

I feel, I'm missing a path variable or a folder structure or something.

 

Dave.


   
Smurf, KenB and Sean451 reacted
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1112
 

@deadlydave

if you want to let someone know you are corresponding to them you need put their @ name so they get an email that someone has mentioned them in a post otherwise your post could be overlooked.

I think the answer to your issue is that you tried to import SSD1306 and not ssd1306.  Its all case sensitive in programming. 😀 


   
DeadlyDave, Smurf and Sean451 reacted
ReplyQuote
Page 3 / 5