GY-63_MS5611/libraries/HT16K33/examples/demo_displayUnit/demo_displayUnit.ino

67 lines
1.4 KiB
Arduino
Raw Normal View History

2022-11-20 04:12:01 -05:00
//
// FILE: demo_displayUnit.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// URL: http://www.adafruit.com/products/1002
// URL: https://github.com/RobTillaart/HT16K33
#include "HT16K33.h"
HT16K33 seg(0x70);
void setup()
{
Serial.begin(115200);
Serial.println(__FILE__);
seg.begin();
Wire.setClock(100000);
seg.displayOn();
seg.setDigits(4);
// default followed by HT16K33_SPACE
seg.displayUnit(1.23, 0); // no unit
seg.displayUnit(1.23, 1);
seg.displayUnit(1.23, 2);
Serial.println();
// now followed by HT16K33_A
seg.displayUnit(1.23, 0, HT16K33_A); // Ampere
seg.displayUnit(1.23, 1, HT16K33_A);
seg.displayUnit(1.23, 2, HT16K33_A);
Serial.println();
seg.displayUnit(-1.23, 0, HT16K33_C); // Celsius
seg.displayUnit(-1.23, 1, HT16K33_C);
seg.displayUnit(-1.23, 2, HT16K33_C);
Serial.println();
seg.displayUnit(12.3, 0, HT16K33_F); // Fahrenheit
seg.displayUnit(12.3, 1, HT16K33_F);
seg.displayUnit(12.3, 2, HT16K33_F);
Serial.println();
seg.displayUnit(12.3, 0, HT16K33_TOP_C); // c
seg.displayUnit(12.3, 1, HT16K33_TOP_C);
seg.displayUnit(12.3, 2, HT16K33_TOP_C);
Serial.println();
seg.displayUnit(12.3, 0, HT16K33_DEGREE); // °
seg.displayUnit(12.3, 1, HT16K33_DEGREE);
seg.displayUnit(12.3, 2, HT16K33_DEGREE);
Serial.println();
Serial.println("done");
}
void loop()
{
}
// -- END OF FILE --