Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

CircuitPython
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CircuitPython

by jerry1140 on Thu Apr 30, 2020 10:42 pm

I'm here because I want to be able to use environmental sensors on my Raspberry Pi. I'm new to this and I am having trouble installing CircuitPython on my Pi. I have installed Mu. I am currently trying to set up a pms5003 particle counter but when I plug it into my Pi with the USB/TTL adapter Mu does not detect it but I can hear its fan running. I tried to set it up on the Pi's UART but I can't hear the fan so I went back to the USB adapter. What is confusing to me is when I go to download CircuitPython all I see on the website is all the small individual board files. Where is the CircuitPython program? Does the CircuitPython program need to be installed before Mu can detect the pms5003? From what I have read about the pms5003 it does not need a library to run but looks like it needs a code file named PMS5003_example.py. I may be so new to this that I have missed some of the basics. Can anyone give me an idea of where to start learning how to set up and use sensors or any I/O device on the Raspberry Pi? Any help would be appreciated.
Thanks,
Jerry Poor

jerry1140
 
Posts: 5
Joined: Sun Mar 15, 2020 5:50 pm

Re: CircuitPython

by jerryn on Fri May 01, 2020 6:10 am

When using the CircuitPyhton libraries on a Raspberry Pi, you are not actually running Circuitpython, you are using a "compatibility" tool to allow you to use many of the CircuitPython libraries. That tool is called "blinka" and must be installed following this guide:

https://learn.adafruit.com/circuitpython-on-raspberrypi-linux as noted here: https://learn.adafruit.com/pm25-air-quality-sensor/python-and-circuitpython#python-computer-wiring-3-4

Even though the PMS5003 does not use a specific sensor library, the example code does use some of the CircuitPython libraries (e.g. busio).

To use the example - you just need to copy it to your Raspberry Pi and run it with python3 with some changes as described here: https://learn.adafruit.com/pm25-air-quality-sensor/python-and-circuitpython#linux-slash-computer-slash-raspberry-pi-with-python-3-12

You can use any code editor you want to edit the script on the Raspberry Pi.

the Mu editor can be used to create and edit Python scripts but it is mainly intended to "connect" to microcontrollers running CircuitPython. It will not "connect" to the PMS5003.


I hope that helps.
Please note, I do not represent Adafruit. Just trying to help.

jerryn
 
Posts: 1251
Joined: Sat Sep 14, 2013 9:05 am

Re: CircuitPython

by jerry1140 on Fri May 01, 2020 2:03 pm

Thanks jerryn for your response. Your advice should help me get started.
Greatly appreciated.
Jerry

jerry1140
 
Posts: 5
Joined: Sun Mar 15, 2020 5:50 pm

Please be positive and constructive with your questions and comments.


cron