-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutput.c
More file actions
49 lines (42 loc) · 1.02 KB
/
Copy pathoutput.c
File metadata and controls
49 lines (42 loc) · 1.02 KB
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
44
45
46
47
48
49
#include <stdio.h>
#include "TI_Lib.h"
#include "tft.h"
#include "general.h"
#include "temperature.h"
static void printROM(Sensor sensor, int nr);
/**
* Initialisierung der Temperaturausgabe
**/
void initTemperatureOutput(void) {
TFT_gotoxy(22,1);
TFT_puts("Temperatures:");
}
/**
* Ausgabe der Temperatur eines Sensors
**/
void printTemperature(Sensor sensor, int nr) {
char stringBuff[20];
snprintf(stringBuff, 20, "%.2f Grad C", sensor.temperature);
TFT_gotoxy(22,1+nr);
TFT_puts(stringBuff);
}
/**
* Ausgabe der ROM Codes aller erkannten Sensoren
**/
void printROMs(int *anzahlS, int maxSensors, Sensor sensorList[maxSensors]) {
TFT_cursor_off();
TFT_set_font_color(WHITE);
TFT_gotoxy(1,1);
TFT_puts("Sensors: ");
for(int i = 0; i < *anzahlS; i++){
printROM(sensorList[i], i+1);
}
}
/**
* Ausgabe des ROM Codes eines Sensors
**/
static void printROM(Sensor sensor, int nr) {
char strBuff[100];
snprintf(strBuff, sizeof(strBuff), "\n\r%d: %llx", nr, *((unsigned long long *) &(sensor.rom)));
TFT_puts(strBuff);
}