-
Notifications
You must be signed in to change notification settings - Fork 1
/
Ausgaben.ino
44 lines (41 loc) · 1.04 KB
/
Ausgaben.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
void printMemory(){
Serial.println(F("Startup:"));
Serial.print(F("# Bytes / Puffer: "));
Serial.println(sizeof(int)*FiFo.getBuffSize());
Serial.print(F("# Len Fifo: "));
Serial.println(FiFo.getBuffSize());
}
void printMsg(){
if (showData){
int *sendVal;
FiFo.setFReadPointerToRead(-mLaenge); //Freien Lesezeiger auf den ersten Wert (-mLänge) der gewünschten Sequenz setzen
for (int i = 1; i <= mLaenge; ++i) {
sendVal = FiFo.getNextValue();
printVal(sendVal);
}
if (writeBin){
Serial.write(highByte(MSGMARK));
Serial.write(lowByte(MSGMARK));
} else {
Serial.println(".");
}
}
}
void printVal(int *sendVal){
if (showData){ //Pufferinhalt anzeigen
if (lineMode) {// in line
Serial.print(*sendVal);
Serial.print(", ");
} else { //or row
if (writeBin){
if (*sendVal==0){
*sendVal =1;
}
Serial.write(highByte(*sendVal));
Serial.write(lowByte(*sendVal));
} else {
Serial.println(*sendVal);
}
}
}
}