Move tube to separate file

This commit is contained in:
cryptogopher
2022-10-09 15:29:30 +02:00
parent 21512bc4f4
commit 374a72fb07
3 changed files with 24 additions and 20 deletions

22
tube.ino Normal file
View File

@@ -0,0 +1,22 @@
#include "grove_alphanumeric_display.h"
Seeed_Digital_Tube tube;
void initTube() {
// Wire initialized by temperature sensor
tube.setTubeType(TYPE_4, TYPE_4_DEFAULT_I2C_ADDR);
tube.setBrightness(15);
tube.setBlinkRate(BLINK_OFF);
tube.setPoint(true,true);
}
void updateTube() {
char tube_str[5];
if (countdown <= 0)
sprintf(tube_str, "%4u", (unsigned int) (temperature * 100.0));
else
sprintf(tube_str, "%4u", countdown);
tube.displayString(tube_str);
}