Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

How to use CP Express sensory data with other program.
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

How to use CP Express sensory data with other program.

by ClericMT on Mon May 11, 2020 11:58 am

I am using CircuitPython with my Circuit Playground Express connected to Raspberry Pi 4 via USB.

I have some servo motors connected to the rPi's GPIO pins and I would like them to respond to the sensory data given from the Circuit Playground

(i.e when a certain frequency detected through the sound sensor the servo motor runs forward)

What is the best way to go about this? I can see the sensory data in the CircuitPython REPL but I can't use the information to control the servo motors

ClericMT
 
Posts: 6
Joined: Mon May 11, 2020 11:45 am

Re: How to use CP Express sensory data with other program.

by mikeysklar on Mon May 11, 2020 2:04 pm

Hi ClericMT,

There is probably multiple ways to pull data from your CPX into the RPI. I think the most elegant solution is to use the filesytem of your CPX to log the sound sensor data. You can open a file from the CPX script write it to the USB mounted CPX drive which your Raspberry Pi system can also read from. Your RPI could have a program running that is constantly checking the mounting CPX USB sensory file.

Here is a link showing what your CPX code.py and boot.py will need to have added so that you can write to the filesystem.

https://learn.adafruit.com/adafruit-cir ... on-storage

mikeysklar
 
Posts: 2007
Joined: Mon Aug 01, 2016 8:10 pm

Re: How to use CP Express sensory data with other program.

by ClericMT on Tue May 12, 2020 4:29 am

Perfect that is what I was looking for. Thanks

ClericMT
 
Posts: 6
Joined: Mon May 11, 2020 11:45 am

Please be positive and constructive with your questions and comments.