Random Ramblings on LabVIEW Design

Community Browser
Labels
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: LabVIEW Firmata - Easy control of Arduino Microcontrollers

swatts
Active Participant

Hello Lovers of cheap hardware,

Wanna spend $20 and get AnIns, Digital Outputs and Digital Inputs, this is the article for you.

 

First the hardware.

If memory serves the LattePanda V1 has an Arduino Leonardo on it, this is based on ATmega32u4 (datasheet), this is what I bought Arduino Leonardo.

I then loaded the very nice Arduino IDE and load some of that weird text stuff onto the device. Instructable Instructions here.

 

And now things get annoying, information on this very simple protocol was sadly lacking or of dubious quality. Rather than just show example messages and returns I had to dig through code and then test the mapping to the controller pins. Some of this is just the nature of micro-controllers (every pin does a thousand different things!). Some of it is the nature of Open-source projects.

 

To make things simple I just implemented enough to make it useful for our projects. So 6 x 10 bit analog inputs, 4 digital inputs and 5 digital outputs. I tried to avoid some of the communication and control pins for the future.

 

The following image shows what's what and where.

 

swatts_0-1708420815366.png

 

To try and document the pins and messages better I built little message generators. Code will be attached (LV2020)

 

swatts_0-1708108887368.png

swatts_6-1708109667131.png

 

I also made some helper VIs to for mapping the pin numbers (they change for different functions!)

 

Next you need to decipher the returned bytes.

 

Thanks to KMurphs https://github.com/KMurphs/labview-client-for-firmata for saving me time on some of the conversion stuff, it's always a pain.

 

swatts_7-1708109917612.png

Attached is a project example and this shows how it all goes together.

 

swatts_8-1708110010343.png

 

Here's a video of it working.

 

The attached project is written in LabVIEW 2020.

 

PS: I have now tested it on the LattePanda Delta V3 and it all works very nicely. The next job is to get SQLite working in Linux, so I can build a template for projects.

 

 

Lots of love

Steve


Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop


Random Ramblings Index
My Profile

Comments
Thoric
Trusted Enthusiast

Really great work Steve. Keep going! 💪

Thoric (CLA, CLED, CTD and LabVIEW Champion)


swatts
Active Participant

Just got SQLite going on the LattePanda, so that's my company template sorted. It's all going very well.

Steve


Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop


Random Ramblings Index
My Profile