mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
37 lines
551 B
Arduino
37 lines
551 B
Arduino
|
//
|
||
|
// FILE: HC4052_demo.ino
|
||
|
// AUTHOR: Rob Tillaart
|
||
|
// PURPOSE: Demo for HC4052 2x4 channel (simple) multiplexer
|
||
|
|
||
|
|
||
|
#include "HC4052.h"
|
||
|
|
||
|
HC4052 mp(4, 5, 6);
|
||
|
|
||
|
|
||
|
void setup()
|
||
|
{
|
||
|
Serial.begin(115200);
|
||
|
Serial.println(__FILE__);
|
||
|
Serial.print("HC4052 LIBRARY VERSION: ");
|
||
|
Serial.println(HC4052_LIB_VERSION);
|
||
|
Serial.println();
|
||
|
|
||
|
delay(1000);
|
||
|
}
|
||
|
|
||
|
|
||
|
void loop()
|
||
|
{
|
||
|
for (uint8_t channel = 0; channel < 4; channel++)
|
||
|
{
|
||
|
mp.setChannel(channel);
|
||
|
Serial.println(analogRead(A0));
|
||
|
delay(100);
|
||
|
}
|
||
|
Serial.println();
|
||
|
}
|
||
|
|
||
|
|
||
|
// -- END OF FILE --
|