Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Linx Digital write to AO

Solved!
Go to solution

I've been running Makerhub Linx to control a Arduino nano for quite a few years and it works great for SPI and DO pins. I've been tasked with using the AO pins as Digital outputs. I know the nano will do this as I've tested with standard Arduino code. I can't get it to work in Labview. I hope someone here can help.

Thanks

Richard Hutchings

0 Kudos
Message 1 of 2
(446 Views)
Solution
Accepted by topic author RHutchings

The problem seems to be with the firmware provided by LINX Firmware Wizzard.

In files LinxArduinoNano328.cpp and LinxArduinoNano328.h only 14 channels are defines as ditigal.

The previous solution posted here (though it has been removed) opted to modify LINX Digital Write 1 Chan.vi by removing error checking.  Note tis solution is risky and definatelly not recommended.   

A possible more permanent solution is to modify the firmware files and to upload the firmware using Arduino IDE. 

The following lines need to be changed in the firmware.

In file LinxArduinoNano328.cpp
Change the following line from: 
//DIGITAL
const unsigned char LinxArduinoNano328::m_DigitalChans[NUM_DIGITAL_CHANS] ={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
to
//DIGITAL
const unsigned char LinxArduinoNano328::m_DigitalChans[NUM_DIGITAL_CHANS] ={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
In file LinxArduinoNano328.h
#define NUM_DIGITAL_CHANS 14
was changed to
#define NUM_DIGITAL_CHANS 20
 
The modified firmeware may then be checked via LINX - Blink (simple).vi.  With Pre-Built firmware the highest Digital Output Channel that may be used is 13 (an error is reported if channel higher than 13 is selected) After firmware modification channels can now be selected up to 19 with Channel 14 corresponsding to A0, ch15 to A1 etc..
0 Kudos
Message 2 of 2
(347 Views)