Code rewritten without Arduino.h

This commit is contained in:
KoroLion 2021-01-24 12:35:26 +03:00
parent 76c649475a
commit 8ca42b59b2

View File

@ -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); int main() {
lm35_init(17);
led_init(); led_init();
}
void loop() { while (true) {
uint8_t t = lm35_read(); unsigned char t = lm35_read();
if (t >= 30) { if (t >= LED_TEMP) {
led_enable(); led_enable();
} else { } else {
led_disable(); led_disable();
} }
}
Serial.println(t);
return 0;
} }