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.
Diff: master.cpp
- Revision:
- 0:ab6b71828f52
diff -r 000000000000 -r ab6b71828f52 master.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/master.cpp Wed Nov 03 15:36:25 2021 +0000
@@ -0,0 +1,25 @@
+#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);
+ }
+
+ }
\ No newline at end of file