fantemp/thermistor/main.cpp
2020-03-29 04:18:26 +02:00

38 lines
588 B
C++

#include "clock.hpp"
#include <stdint.h>
#include "flash/flash.hpp"
#include "io/io.hpp"
#include "uart/uart.hpp"
#define ADC_INT_VECTOR
#include "adc/adc.hpp"
#define UART0_INT_VECTORS
#include "uart/hardware0.hpp"
int main()
{
uart::Uart0<> serial;
serial.init();
serial << F("Thermistor reader\r\n");
using adc_conf = adc::Config<adc::SingleMode>;
adc::Adc<adc_conf, io::P, io::P::C0> adcPin;
adcPin.init();
while (true) {
auto adcSample = adcPin.read();
serial << F("Read ADC: ") << adcSample << F("\r\n");
_delay_ms(1000);
}
serial.flushTx();
return 0;
}