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

Arduino IDE with PyPortal
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Arduino IDE with PyPortal

by Indymx on Tue Jun 02, 2020 9:12 am

Is there a definitive guide for setting up Arduino IDE for use with PyPortal?

I have followed what's on here and am still having errors. Even with the code.py that ships on the pyportal, it's failing. With no modifications to the code.py here's the first error I get:

Arduino: 1.8.12 (Linux), Board: "Adafruit PyPortal M4 (SAMD51), Enabled, 120 MHz (standard), Small (-Os) (standard), 50 MHz (standard), Arduino, Off"

sketch_jun02a:5:3: error: invalid preprocessing directive #Set
# Set up where we'll be fetching data from
^~~
sketch_jun02a:10:3: error: invalid preprocessing directive #the
# the current working directory (where this file is)
^~~
sketch_jun02a:26:3: error: invalid preprocessing directive #speed
# speed up projects with lots of text by preloading the font!
^~~~~
exit status 1
invalid preprocessing directive #Set

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


What am I doing wrong here?

Indymx
 
Posts: 5
Joined: Tue Mar 03, 2020 6:35 am

Re: Arduino IDE with PyPortal

by dastels on Tue Jun 02, 2020 10:36 am

You're using Python commentting in C++ code. Change the '#' comment characters to '//'.

Dave

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

Re: Arduino IDE with PyPortal

by dastels on Tue Jun 02, 2020 10:38 am

I missed it first time... but are you using Python with the Arduino IDE? That won't work. Arduino is just C++. You can use Mu for CircuitPython if you like: https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor?preview_token=WsdVgHQVBTr9iHLerIfyWA.

Dave

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

Re: Arduino IDE with PyPortal

by Indymx on Tue Jun 02, 2020 10:56 am

I have tried Mu and it doesn't work very well on my system. Not sure why.

If I change the MODE to Adafruit CircuitPython, Mu crashes.

Indymx
 
Posts: 5
Joined: Tue Mar 03, 2020 6:35 am

Re: Arduino IDE with PyPortal

by Indymx on Tue Jun 02, 2020 11:09 am

Here's my log:

2020-06-02 11:00:40,053 - mu.logic:1074(select_mode) INFO: New mode selected: adafruit
2020-06-02 11:00:40,070 - root:95(excepthook) ERROR: Unrecoverable error
Traceback (most recent call last):
File "/snap/mu-editor/4/lib/python3.5/site-packages/mu/logic.py", line 1075, in select_mode
self.change_mode(new_mode)
File "/snap/mu-editor/4/lib/python3.5/site-packages/mu/logic.py", line 1112, in change_mode
self.modes[mode].workspace_dir()))
File "/snap/mu-editor/4/lib/python3.5/site-packages/mu/modes/adafruit.py", line 98, in workspace_dir
mount_output = check_output(mount_command).splitlines()
File "/snap/mu-editor/4/usr/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/snap/mu-editor/4/usr/lib/python3.5/subprocess.py", line 693, in run
with Popen(*popenargs, **kwargs) as process:
File "/snap/mu-editor/4/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/snap/mu-editor/4/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
PermissionError: [Errno 13] Permission denied


There is no "/snap/mu-editor//4/lib/python3.5/site-packages/

Looks like I have a broken install, any ideas how to fix it?

Indymx
 
Posts: 5
Joined: Tue Mar 03, 2020 6:35 am

Re: Arduino IDE with PyPortal

by Indymx on Tue Jun 02, 2020 11:37 am

I got it working....

Indymx
 
Posts: 5
Joined: Tue Mar 03, 2020 6:35 am

Please be positive and constructive with your questions and comments.