



Da doch einige Anfragen zur Ansteuerung eines TM1638 mit dem rcc gekommen sind, habe ich hier mal ein einfaches Beispiel für eine Drehzahlanzeige gemacht.
//https://github.com/rjbatista/tm1638-library
#include
// define a module on data (DIO) pin 8, clock (CLK) pin 9
// and strobe (STB0)pin 10
TM1638 module(8, 9, 10);
String ver = "2.0.0.0";
const int nChar = 30; // size of char
String inString = ""; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete
int vRpm;
void setup()
{
Serial.begin(38400);
}
void readdata() {
if (stringComplete) {
if (inString.substring(0, 2) == "RR") {
vRpm = inString.substring(2, 6).toInt();
module.setDisplayToDecNumber(vRpm * 10,0,false);
}
inString = "";
stringComplete = false;
}
}
void serialReadEvent() {
while (Serial.available()) {
char inChar = (char)Serial.read();
inString += inChar;
if (inChar == ';') {
stringComplete = true;
}
}
}
void loop() {
serialReadEvent();
readdata();
}