Audio Equipment/Electrical Discussions Based on Automotive Stereo Equipment Such As Amps , Head Units & Speakers Including Installation and System Set Up Information. Electrical or wiring issues on anything that requires wiring.

Arduino Module Programming?

Thread Tools
 
Search this Thread
 
Old May 29, 2012 | 01:29 AM
  #31  
AdrianD's Avatar
Diesel Enthusiast
Joined: Aug 2010
Posts: 98
Likes: 10
From: Transylvania
Default

I think I've figured out why it doesn't work. While pulling to ground, I always checked if the new value is at least 10 ADC units greater than the old value. But on your schematic, if you press a button, the ADC value drops below 1000 to a new value, say 100, the code doesn't catch it and if you hold the button and press another one, the value will jump to over 100 ADC units and it will be caught by the code.

Check this program, it should work ok now, I have not tested it, only going based on what you told me. If it still is iffy, just use the previous version with a different condition, ie. if (prev_input - curr_input > 10)
 
Attached Files
File Type: txt
check_button_value.txt (434 Bytes, 84 views)
Reply
Old May 29, 2012 | 01:39 AM
  #32  
2004LB7's Avatar
Thread Starter
|
Diesel Bomber
Joined: Dec 2010
Posts: 1,190
Likes: 113
From: Fool's Golden State
Default

thanks, i will give it a shot.

one thing i discovered is that the relay board i am using requires that the "on" pins be pulled to ground to activate the relays. i guess that means in the programming the pins used on the Arduino board will need to go low or "grounded" when on
 
Reply
Old May 29, 2012 | 02:39 AM
  #33  
AdrianD's Avatar
Diesel Enthusiast
Joined: Aug 2010
Posts: 98
Likes: 10
From: Transylvania
Default

Test it and let me know

The pins can be set to active low or active high but you will need something to be able to drive the relays, the chip cannot drive a relay.
 
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
D K
Ford Powerstroke 99-03 7.3L
0
May 17, 2015 11:27 AM
chris_fininzio
Ford 83-94 6.9 and 7.3L General
0
Dec 17, 2014 10:50 AM




All times are GMT -5. The time now is 04:01 AM.