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.
ADC.cpp
- Committer:
- BenRJG
- Date:
- 2018-04-05
- Revision:
- 5:11489c0bd020
- Child:
- 9:a7085b7503d2
File content as of revision 5:11489c0bd020:
#include "ADC.h"
int read_adc(void){
int adval_d;
float adval_f;
adval_d = spi_read_data(CS_ADC);
adval_f = 3.3f*((float)adval_d/4095);
printf("%d %.3fV\r\n",adval_d,adval_f);
return adval_f;
}
