Macropad RP2040 read json file on PC drive

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
europasteve
 
Posts: 12
Joined: Mon Nov 07, 2011 8:38 am

Macropad RP2040 read json file on PC drive

Post by europasteve »

Hello, Is there a way for CircuitPython running on the Macropad RP2040 to read a file (status.json) thats on my PC C Drive over USB? I’m new to all this and have been googling for a couple of days to no avail. Writing the file directly to Macropad works but causes the Macropad to reboot. The game file status.json is overwritten in the game many time a minute making this unworkable.

Thanks

User avatar
dastels
 
Posts: 15655
Joined: Tue Oct 20, 2015 3:22 pm

Re: Macropad RP2040 read json file on PC drive

Post by dastels »

I'm not aware of any way you could read a file on the PC over USB.

The best/only approach is to have the file on the MacroPad. You can disable the auto-reload when files change. See https://learn.adafruit.com/welcome-to-c ... ly-3108374.

Dave

User avatar
danhalbert
 
Posts: 4649
Joined: Tue Aug 08, 2017 12:37 pm

Re: Macropad RP2040 read json file on PC drive

Post by danhalbert »

If the file is rewritten many times a minute you may eventually wear out the flash. Consider sending the data over USB serial to the MacroPad instead of writing a file: https://learn.adafruit.com/customizing- ... ta-3096590. You will write the data to COM<something> on Windows. You could write a Python script that runs on the host computer to do that.

User avatar
europasteve
 
Posts: 12
Joined: Mon Nov 07, 2011 8:38 am

Re: Macropad RP2040 read json file on PC drive

Post by europasteve »

I'll start looking into sending the data over USB serial. Thanks for the help.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”