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.
master.cpp
- Committer:
- domemort
- Date:
- 2021-11-03
- Revision:
- 0:ab6b71828f52
File content as of revision 0:ab6b71828f52:
#include "mbed.h"
SPI port(D11, D12, D13);
DigitalOut cs(D7);
AnalogIn adc_temp(ADC_TEMP);
char buffer[2];
int main(){
cs=1;
port.format(8,3);
port.frequency(1000000);
while(1){
cs=1;
buffer[0] = adc_temp.read();
buffer[1] = adc_temp.read()<<8;
cs=0;
port.write(buffer[0]);
cs=1;
cs=0;
port.write(buffer[1]);
wait_ms(50);
}
}