Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed SDFileSystem
ADC_Internal.cpp
00001 #ifdef COMPILE_ADC_Internal 00002 00003 /* 00004 This basic example just shows how to read the ADC internal channels raw values. 00005 Please look in the corresponding device reference manual for a complete 00006 description of how to make a temperature sensor, VBat or Vref measurement. 00007 */ 00008 00009 AnalogIn adc_temp(ADC_TEMP); 00010 AnalogIn adc_vref(ADC_VREF); 00011 AnalogIn adc_vbat(ADC_VBAT); // Warning: Not available on all devices 00012 00013 DigitalOut led(LED1); 00014 00015 int main() 00016 { 00017 printf("\nSTM32 ADC internal channels reading example\n"); 00018 while(1) { 00019 printf("ADC Temp = %f\n", adc_temp.read()); 00020 printf("ADC VRef = %f\n", adc_vref.read()); 00021 printf("ADC VBat = %f\n", adc_vbat.read()); 00022 printf("\033[3A"); 00023 led = !led; 00024 wait(1.0); 00025 } 00026 } 00027 00028 #endif
Generated on Fri Jul 15 2022 04:49:55 by
1.7.2