esp-wroom-02

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
maxnagazumi
Date:
Wed Apr 08 05:08:26 2020 +0000
Commit message:
ESPwroo-02

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r f901fe60938a main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Apr 08 05:08:26 2020 +0000
@@ -0,0 +1,36 @@
+#include "mbed.h"
+
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+
+SPISlave GetMes(p5,p6,p7,p8);
+
+Ticker spiTicker;
+
+int data,receive;
+void ticker_spiRead()
+{
+    if(GetMes.receive()) {
+        receive = 1;
+        data = GetMes.read();
+        GetMes.reply(1);
+    } else {
+        receive = 0;
+    }
+}
+
+int main()
+{
+    GetMes.frequency(2000000);
+    GetMes.format(8,0);
+    spiTicker.attach(&ticker_spiRead,0.1);
+    led1=0;
+    if(receive == 1) {
+        led1=1;
+        printf("SPI = %d\r\n",data);
+    }
+
+    wait(0.2);
+}
diff -r 000000000000 -r f901fe60938a mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Apr 08 05:08:26 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file