mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
80 lines
1.1 KiB
C++
80 lines
1.1 KiB
C++
//
|
|
// FILE: MAX14661_MUX.ino
|
|
// AUTHOR: Rob Tillaart
|
|
// VERSION: 0.1.0
|
|
// PURPOSE: demo PAIR interface
|
|
// DATE: 2021-01-29
|
|
// URL: https://github.com/RobTillaart/MAX14661
|
|
//
|
|
|
|
|
|
#include "Wire.h"
|
|
#include "MAX14661.h"
|
|
|
|
MAX14661 mux(0x62);
|
|
|
|
|
|
void setup()
|
|
{
|
|
Serial.begin(115200);
|
|
Serial.println(__FILE__);
|
|
Serial.println(MAX14661_LIB_VERSION);
|
|
|
|
if (mux.begin() == false)
|
|
{
|
|
Serial.println("Could not find MAX14661");
|
|
while (1);
|
|
}
|
|
|
|
test1();
|
|
test2();
|
|
test3();
|
|
}
|
|
|
|
|
|
void test1()
|
|
{
|
|
Serial.println("\nTEST 1");
|
|
for (int ch = 0; ch < 16; ch++)
|
|
{
|
|
mux.MUXA(ch);
|
|
Serial.println(mux.getMUXA(), HEX);
|
|
}
|
|
mux.MUXA(255);
|
|
Serial.println(mux.getMUXB(), HEX);
|
|
}
|
|
|
|
|
|
void test2()
|
|
{
|
|
Serial.println("\nTEST 1");
|
|
for (int ch = 0; ch < 16; ch++)
|
|
{
|
|
mux.MUXB(ch);
|
|
Serial.println(mux.getMUXB(), HEX);
|
|
}
|
|
mux.MUXB(255);
|
|
Serial.println(mux.getMUXB(), HEX);
|
|
}
|
|
|
|
|
|
void test3()
|
|
{
|
|
Serial.println("\nTEST 1");
|
|
for (int ch = 0; ch < 16; ch++)
|
|
{
|
|
mux.MUXB(ch);
|
|
Serial.println(mux.getMUXB(), HEX);
|
|
}
|
|
mux.MUXB(255);
|
|
Serial.println(mux.getMUXB(), HEX);
|
|
}
|
|
|
|
|
|
void loop()
|
|
{
|
|
}
|
|
|
|
|
|
// -- END OF FILE --
|