Unverified Commit d3c494bb authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

adctest: also runs on msp430fr5994lp

parent c3efbea7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3,4 +3,4 @@
# SPDX-License-Identifier: CC0-1.0

prompt "ADC Test"
depends on meta_driver_adc && arch_arduino_nano && loop && !wakeup
depends on meta_driver_adc && (arch_arduino_nano || arch_msp430fr5994lp) && loop && !wakeup
+10 −1
Original line number Diff line number Diff line
@@ -10,16 +10,25 @@

void loop(void)
{
#ifdef CONFIG_arch_arduino_nano
	uint16_t vcc = adc.getVCC_mV();
	uint16_t temp = adc.getTemp_mdegC();

	kout << "Voltage     " << vcc << " mv" << endl;
	kout << "Voltage     " << vcc << " mV" << endl;
	kout << "Temperature " << temp << " m°C" <<  endl;

	for (uint8_t admux_sel = 0; admux_sel < 8; admux_sel++) {
		kout << "ADC" << admux_sel << "        " << adc.getPin_mV(admux_sel, vcc) << " mV vs AVCC" << endl;
		kout << "ADC" << admux_sel << "        " << adc.getPin_mV(admux_sel) << " mV vs 1.1V bandgap" << endl;
	}
#endif
#ifdef CONFIG_arch_msp430fr5994lp
	float vcc = adc.getVCC();
	float temp = adc.getTemp();

	kout << "Voltage     " <<  vcc << " V" << endl;
	kout << "Temperature " << temp << " °C" <<  endl;
#endif
}

int main(void)