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
00001 #include "mbed.h" 00002 00003 BusOut lb(D2,D3,D6,D9,D11,D12,A6,D13); 00004 DigitalIn T1(A1); 00005 int CheckButton(); 00006 void OneRunLightStepR2(); 00007 int prevButtonState=0; 00008 void main() 00009 00010 { 00011 lb=1; 00012 while(1){ 00013 if (CheckButton()==1) 00014 00015 OneRunLightStepR2(); 00016 00017 } 00018 } 00019 int CheckButton() 00020 { 00021 int ret; 00022 if(prevButtonState== 1 && T1.read()== 0) 00023 ret=1; 00024 else 00025 ret=0; 00026 prevButtonState = T1.read(); 00027 return ret; 00028 } 00029 00030 00031 void OneRunLightStepR2() 00032 { 00033 if (lb==0) 00034 lb = 1; 00035 else 00036 lb = lb<<1; 00037 00038 } 00039
Generated on Sat Jul 23 2022 22:10:03 by
1.7.2