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 #include "RotaryEncode.h" 00003 #include "PCA9532.h" 00004 00005 RotaryEncode RE(p16,p17); 00006 PCA9532 leds (p28,p27,0xc0); 00007 00008 int main() { 00009 00010 int position = 0; 00011 00012 while(1) { 00013 00014 int offset = RE.read(); 00015 00016 if ((offset > 0) && (position < 15)) { 00017 position++; 00018 } 00019 else if ((offset < 0) && (position > 0)) { 00020 position--; 00021 } 00022 00023 leds.write(0x1 << position); 00024 wait (0.2); 00025 00026 } 00027 } 00028 00029
Generated on Fri Jul 15 2022 02:53:23 by
1.7.2