This repository has been archived by the owner on Feb 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.c
99 lines (86 loc) · 1.8 KB
/
test.c
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
* test.c
*
* Created on: 9 Feb 2019
* Author: alex
*/
#include "test.h"
#include "delay.h"
#include "led.h"
#include "button.h"
#include "display.h"
#include "thermometer.h"
#include <msp430.h>
void delayTest()
{
static unsigned value = 0;
DELAY_MS(1000);
value ^= 1;
displayHRT(value);
}
void ledTest()
{
led_new(LED_RED);
led_new(LED_GREEN);
led_on(LED_RED);
led_toggle(LED_GREEN);
led_off(LED_RED);
led_toggle(LED_GREEN);
}
void noopLeft()
{
// should be visited when left button is pressed
}
void noopRight()
{
// should be visited when right button is pressed
}
void buttonTest()
{
button_new(BUTTON_LEFT, &noopLeft);
button_new(BUTTON_RIGHT, &noopRight);
}
void displayTest()
{
displayTemperature(0.0);
displayTemperature(-1.0);
displayTemperature(-1.5);
displayTemperature(-1.65);
displayTemperature(1.0);
displayTemperature(1.5);
displayTemperature(1.65);
displayTemperature(-1234.56);
displayBattery(6);
displayHRT(1);
displayTMR(1);
displayEXC(1);
displayREC(1);
displayANT(1);
displayTX(1);
displayRX(1);
displayText("TADAAH");
displayScrollText("HALLO WELT DIESER TEXT KOMMT VON ALEX");
}
void deviceIdTest()
{
volatile deviceaddress_t device = 0;
device = thermometer_getAddress();
__delay_cycles(200000);
}
#define THERMOMETER_COUNT 3
static float temperatures[THERMOMETER_COUNT] = { 0.0 };
static deviceaddress_t devices[THERMOMETER_COUNT] = {
0x0D0114339EA1D228,
0x8A01143392748328,
0x8402131D69F9AA28
};
void temperatureManyTest()
{
thermometer_getTemperaturesC(temperatures, devices, THERMOMETER_COUNT);
uint8_t i = THERMOMETER_COUNT;
while (i--)
{
displayTemperature(temperatures[i]);
__delay_cycles(5000000);
}
}