More than one Digital Read, Issues | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar
Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
More than one Digital Read, Issues
March 13, 2018
3:54 pm
Avatar
rjlabview
Member
Members
Forum Posts: 4
Member Since:
January 11, 2018
sp_UserOfflineSmall Offline

I having issues reading two separate buttons using digital input_pullup & Digital Read vi's. When I run the serial monitor I can only get one of the two digital reads to react when my buttons are pressed. If I run a single digital pin, I can verify that both pins are wired and functionally work. However running both at the same time only one input works. My project requires two buttons, any help would be greatly appreciated. See attached program. 

 

Arduino Mega ADK 
LabVIEW 2016 Version 16, 32 bit 
Version: 1.0.0.21

March 14, 2018
12:02 am
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Can you post your VI?

March 14, 2018
12:19 pm
Avatar
rjlabview
Member
Members
Forum Posts: 4
Member Since:
January 11, 2018
sp_UserOfflineSmall Offline

Didn't see that you had to upload the file after you drag it in, here it is.

March 14, 2018
5:43 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Can you save this for LV2015 and repost?

March 15, 2018
5:35 pm
Avatar
rjlabview
Member
Members
Forum Posts: 4
Member Since:
January 11, 2018
sp_UserOfflineSmall Offline

2015 Version 

March 15, 2018
6:35 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Everything looks fine to me.  I tried your code on an Arduino Due (very similar pinouts to the Mega) and both inputs worked as expected with the exact same code.  You might want to slow down the loop rate and identify which pin is which on your serial output.  But here is what I got.  Had one pin tied to ground then connected the other to ground (all 0s as expected).  I would double check your wiring.

Digital-Test.pngImage Enlarger

sp_PlupAttachments Attachments
Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
30
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356