Notifications
Clear all

Arduino & PlatformIO  


codecage
(@codecage)
Member Admin
Joined: 2 years ago
Posts: 1002
Topic starter  

I understand that Bill may eventually do a video on this, and I anxiously await that video!  But in the mean time I wanted to see how others may be using PlatformIO.

On my laptop I have PIO loaded and can edit my Arduino code with it as well as with the Arduino IDE if I want to.  I even noticed, as someone else pointed out, that if I have an ,ino file open in PIO and make a change to that same file with the Arduino IDE on another computer the change shows up on the PIO session (although not the other way around).  Pretty cool, and I love the Intellisense auto-fill.

Now lets move to my Jetson Nano.  On it I have been following the Paul McWhorter series on learning AI on the Jetson Nano.  Here VSC/PIO is using Python as the programming language and everything is just fine.  But when I tried to add the Arduino environment to PIO my Arduino code isn't utilizing the Intellisense mechanism.  I do remember a popup warning/error about "incompatibility with ARM64" or something to that affect.

Has anyone else tried this and been successful?

SteveG


Quote
Robo Pi
(@robo-pi)
Robotics Engineer Moderator
Joined: 2 years ago
Posts: 1909
 
Posted by: @codecage

Has anyone else tried this and been successful?

Unfortunately I don't have an answer for you.  However, I do recall messing around with the OSS IDE that I installed on the Jetson Nano via Paul's lesson.   I also vaguely recall checking to see if it will do the Arduino code.  I remember seeing that it offers that option.  What I don't recall is exactly how far I went with it after that.   The problem is that I've been trying so many different things lately.  I do have Visual Studio set up to run the Arduino code on a laptop computer.   I'll have to go back and see exactly where I had left off on the Jetson Nano with that.   One of the reasons I didn't pursue it deeply was because I simply didn't need it on the Jetson nano at that time.  I was basically just looking into whether it would support it and it appears that it does.

I also recall having the problem you mentioned about not seeing the Arduino commands in the intellisense.  What I don't recall is whether that was on the Jetson Nano OSS studio, or whether that was on the Laptop Visual Studio IDE.  Whichever one it was I do remember that there was a solution and I solved the problem.  Unfortunately I don't recall off the top of my head exactly how I had solved that  problem.

If I can find time later tonight I'll try to see if I can figure out where I  left off with that.   I'm working with Blender and Kdenlive today trying to figure out which is best for use as a video editor on the Jetson Nano.  Currently Kdenlive appears to be winning that contest.

I'm having severe problems trying to create videos efficiently.  But I'm slowly making progress.  A large part of it is trying to figure out which tools are the most efficient.  I recently got side-tracked into looking at using Blender as a video editor, but it is extremely slow on the Jetson Nano, so I'm back to Kdenlive again.

DroneBot Workshop Robotics Engineer
James


ReplyQuote
ZeFerby
(@zeferby)
Reputable Member
Joined: 2 years ago
Posts: 380
 
Posted by: @codecage

make a change to that same file with the Arduino IDE on another computer the change shows up on the PIO session (although not the other way around)

I don't have a Jetson Nano so I can't say anything about your question, but as an aside about the point above, the Arduino IDE can be switched to track the changes applied from another editor with the Preferences / "Use external editor" check box, though its own editor then works in read-only mode.

Eric


ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer Moderator
Joined: 2 years ago
Posts: 1909
 

@codecage

I haven't yet looked into this, but my untrustworthy memory neurons seem to be recalling something about including the Arduino directory in some sort of preference file so the intellisense can know where to find the Arduino keywords. 

The other thing I vaguely recall is that after I got the Arduino keywords and commands to show up in the Intellisense they were mixed in with a whole bunch of other commands and keywords that aren't related to the Arduino.   So you'd get these huge intellisense lists with Arduino keywords sprinkled throughout a lot of other keywords that you'd probably never use with the Arduino.   I would imagine there's probably a way to filter out the unwanted keywords, but I'm sure I didn't get that far along.  All I wanted to do was see if I could make it work.  I didn't have a use for it at the time, so I moved on to other things once I saw that it was doable.

DroneBot Workshop Robotics Engineer
James


ReplyQuote
byron
(@byron)
Reputable Member
Joined: 2 years ago
Posts: 479
 

@codecage

I'm using platformIO both for Python and Arduio and intellisense works OK for both.  My setup is that VS code runs on my mac and the arduino extension is the microsoft one (I think there are others).  I once did wonder what happened to my intellisense but realised I had not named the file x.py or x.ino, but apart from senior moments all has been working on my set-up


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 2 years ago
Posts: 1002
Topic starter  

@byron

Thanks, I'll double check if I had the .ino extension on my Arduino file, but I sure thought I had included it.

SteveG


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 2 years ago
Posts: 1002
Topic starter  

@byron

Although my original post was about adding the Arduino environment to the VSC/Python platform that I already had on my Jetson Nano.  That is where I was not seeing the Intellisense for Arduino code.  I went back and uninstalled and started over and now it seems to work OK.  Guess I'll never know where I went wrong before, but now that it isn't broke I'm not going to try to fix it again.

On my Windows 10 machines it was already working.  Thanks for getting me thinking along the right path.

SteveG


ReplyQuote