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.
main.cpp
- Committer:
- nanami773
- Date:
- 2022-04-09
- Revision:
- 0:fc8def55775b
File content as of revision 0:fc8def55775b:
#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;
}