Nanami Takahashi / Mbed 2 deprecated encoder

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
nanami773
Date:
Sat Apr 09 00:21:14 2022 +0000
Commit message:
a;

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Apr 09 00:21:14 2022 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+
+InterruptIn aphase(D0);
+InterruptIn bphase(D1);
+DigitalOut led1(D2);
+DigitalOut led2(D3);
+void elses();
+void interrupt();
+int a=0;
+
+
+int main(){
+    if(aphase==1){
+       if(bphase==0){
+          bphase.fall(&interrupt);
+        }}
+     if(aphase==1){
+         if(bphase==1){
+            bphase.rise(&elses);
+        }}
+    //(aphase.rise)&&(bphase.fall)(&interrupt);
+    //(aphase.rise)&&(bphase.rise)(&elses);
+    
+    while(1) {
+    }
+}
+
+void interrupt(){
+          if(a==0){
+          led1=!led1;
+          led2=0;
+          a=1;
+          }
+        }
+       
+void elses(){ 
+         a=0;
+         led2=!led2;
+         led1=0;
+       }       
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Apr 09 00:21:14 2022 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file