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

CircuitPython newbie needs advice
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CircuitPython newbie needs advice

by ramsh on Mon Jun 15, 2020 9:59 am

Hello,

I'm VERY excited to do my current project with CircuitPython!!!

I'm using Adafruit Feather STM32F405 Express running firmware:

Code: Select all | TOGGLE FULL SIZE
adafruit-circuitpython-bundle-5.x-mpy-20200613

using Mu Editor i successfully run the py version of Blink, awesome!!!!

I've got to the lib part where I wanted to know what libs (from CircuitPython Libraries) are needed from the zip for this project, the board is connected via Qwiic to:

[*]Adafruit ICM-20649 Wide Range ±30g ±4000dps 6-DoF IMU - STEMMA QT / Qwiic
[*]Adafruit LSM303AGR Accelerometer Magnetometer - STEMMA QT Qwiic

it reads analog input from:
Analog 2-axis Thumb Joystick with Select Button + Breakout Board

and lastly, it also should send and receive data through UART

can you please point me the libs i need to copy to the lib folder in CIRCUITPY?

many many thanks in advance!!
best,
Ram

PS,
did i mantion how excited i am to use python on a feather?! :)

ramsh
 
Posts: 98
Joined: Fri Apr 29, 2016 5:17 am

Re: CircuitPython newbie needs advice

by dastels on Mon Jun 15, 2020 11:29 am

Have a look at the tutorial guides for those sensors. The "Python & CircuitPython" pages will detail what libraries you need and how to install them.

https://learn.adafruit.com/adafruit-icm20649-wide-range-6-dof-imu-accelerometer-and-gyro
https://learn.adafruit.com/lsm303-accelerometer-slash-compass-breakout/

Make sure you're using the latest stable version of CircuitPython (5.3.0 at the moment).

You can have a look at https://learn.adafruit.com/remote-iot-environmental-sensor for examples of using the UART.

Dave

dastels
 
Posts: 2829
Joined: Tue Oct 20, 2015 3:22 pm

Re: CircuitPython newbie needs advice

by ramsh on Tue Jun 16, 2020 8:26 am

Many thanks for the links!!

I'm following the tutorial for the ICM20649 and I probably missing something as I get an error, the sensor is connected to the board via Qwiic:
Image

the board CIRCUITPY/lib has the files that are needed to the sensor:
Image

and the code.py has the following example code:
Image
(sorry for using an image for code but when i tried to use the code itself in the message i got this message: "Your message contains banned spam words. Please rephrase your post without the following words: i_c _m" without the underscores)

when I run the code from above I get this error:
Code: Select all | TOGGLE FULL SIZE
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 7, in <module>
  File "adafruit_icm20x.py", line 527, in init
  File "adafruit_icm20x.py", line 244, in init
  File "adafruit_icm20x.py", line 249, in initialize
  File "adafruit_icm20x.py", line 275, in _sleep
  File "adafruit_icm20x.py", line 235, in _bank
  File "adafruit_register/i2c_struct.py", line 94, in set
RuntimeError: maximum recursion depth exceeded


can you please point me to what is it I'm missing here?

once again, many thanks for your support!

ramsh
 
Posts: 98
Joined: Fri Apr 29, 2016 5:17 am

Re: CircuitPython newbie needs advice

by dastels on Tue Jun 16, 2020 11:21 am

I don't see anything wrong with your code (or your choice of variable names!). Make sure you have the version of the ICM20x library from the latest version of the bundle.

If the problem persists I'll ask around.

Dave

dastels
 
Posts: 2829
Joined: Tue Oct 20, 2015 3:22 pm

Re: CircuitPython newbie needs advice

by ramsh on Tue Jun 16, 2020 12:03 pm

i have used the files and folders from June 16, 2020 auto-release (i attached the lib content to this post)
is that the correct version of the ICM20x library?
besides those files is there anything else i need to do for the ICM20x library installation?
Attachments
lib.zip
(15.04 KiB) Not downloaded yet

ramsh
 
Posts: 98
Joined: Fri Apr 29, 2016 5:17 am

Re: CircuitPython newbie needs advice

by dastels on Tue Jun 16, 2020 12:13 pm

That's the latest.

No, if the imports all work, if should be fine. It will complain/stop if it can't find what it needs.

Dave

dastels
 
Posts: 2829
Joined: Tue Oct 20, 2015 3:22 pm

Re: CircuitPython newbie needs advice

by ramsh on Tue Jun 16, 2020 12:30 pm

OK, so nothing else from my end I guess, can you please ask around how to solve this?

Thanks again.
Ram

ramsh
 
Posts: 98
Joined: Fri Apr 29, 2016 5:17 am

Re: CircuitPython newbie needs advice

by adafruit2 on Tue Jun 16, 2020 1:04 pm

thanks, this is an issue we're aware of and tracking here
https://github.com/adafruit/circuitpython/issues/2830
there's no fix just yet - what exact version of circuitpython are you runing? look at boot.out for that info

adafruit2
Site Admin
 
Posts: 19225
Joined: Fri Mar 11, 2005 7:36 pm

Re: CircuitPython newbie needs advice

by ramsh on Tue Jun 16, 2020 1:28 pm

adafruit2 wrote:thanks, this is an issue we're aware of and tracking here
https://github.com/adafruit/circuitpython/issues/2830
there's no fix just yet - what exact version of circuitpython are you runing? look at boot.out for that info


i'm running version:
Code: Select all | TOGGLE FULL SIZE
Adafruit CircuitPython 5.3.0 on 2020-04-29; Feather STM32F405 Express with STM32F405RG

ramsh
 
Posts: 98
Joined: Fri Apr 29, 2016 5:17 am

Re: CircuitPython newbie needs advice

by adafruit2 on Tue Jun 16, 2020 1:31 pm

try the latest 5.4.0 beta

adafruit2
Site Admin
 
Posts: 19225
Joined: Fri Mar 11, 2005 7:36 pm

Re: CircuitPython newbie needs advice

by ramsh on Tue Jun 16, 2020 1:59 pm

adafruit2 wrote:try the latest 5.4.0 beta


Image

the upgrade did the trick!!!!!
Code: Select all | TOGGLE FULL SIZE
Adafruit CircuitPython 5.4.0-beta.1 on 2020-06-08; Feather STM32F405 Express with STM32F405RG

many many thanks!!!

ramsh
 
Posts: 98
Joined: Fri Apr 29, 2016 5:17 am

Please be positive and constructive with your questions and comments.