Code rewritten without Arduino.h
This commit is contained in:
parent
76c649475a
commit
8ca42b59b2
|
@ -1,28 +1,28 @@
|
||||||
// Copyright 2021 KoroLion (https://github.com/KoroLion)
|
// Copyright 2021 KoroLion (https://github.com/KoroLion)
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void lm35_init(uint8_t port);
|
void lm35_init(unsigned char port);
|
||||||
uint8_t lm35_read();
|
unsigned char lm35_read();
|
||||||
|
|
||||||
void led_init();
|
void led_init();
|
||||||
void led_enable();
|
void led_enable();
|
||||||
void led_disable();
|
void led_disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup() {
|
const unsigned char LED_TEMP = 30;
|
||||||
Serial.begin(9600);
|
|
||||||
|
|
||||||
lm35_init(A3);
|
|
||||||
led_init();
|
|
||||||
}
|
|
||||||
|
|
||||||
void loop() {
|
int main() {
|
||||||
uint8_t t = lm35_read();
|
lm35_init(17);
|
||||||
if (t >= 30) {
|
led_init();
|
||||||
led_enable();
|
|
||||||
} else {
|
while (true) {
|
||||||
led_disable();
|
unsigned char t = lm35_read();
|
||||||
|
if (t >= LED_TEMP) {
|
||||||
|
led_enable();
|
||||||
|
} else {
|
||||||
|
led_disable();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Serial.println(t);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user