Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*This uses a function to grab a value from a 16 pin Analog Multiplexer
- http://www.sparkfun.com/commerce/product_info.php?products_id=9056
- to retrieve a value from one of the registers.
- To use: analogExtRead(analogpin, multiplexerpin);
- This can be expanded to use diffrent digital pins as well.
- */
- int digipin[] = {2, 3, 4, 5};
- int analogExtRead(int analogpin, int multiplexerpin)
- {
- for(int i = 0; i < 3; i++)
- {
- digitalWrite(digipin[i], bitRead(multiplexerpin, i));
- }
- return analogRead(analogpin);
- }
- void loop() {}
- void setup() {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement