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 // 00002 // mbed POV by Kanpapa 00003 // May.29,2010 00004 // 00005 00006 // mbed 00007 // p6 input 00008 // p7-p13 output 00009 // 00010 00011 // Original Version 00012 // Japanino POV by Musashinodenpa 00013 // http://otonanokagaku.net/japanino/sketch/index.html 00014 00015 #include "mbed.h" 00016 00017 DigitalIn sw(p6); 00018 00019 DigitalOut led1(p7); 00020 DigitalOut led2(p8); 00021 DigitalOut led3(p9); 00022 DigitalOut led4(p10); 00023 DigitalOut led5(p11); 00024 DigitalOut led6(p12); 00025 DigitalOut led7(p13); 00026 00027 int bitmap[20][8] = { 00028 {0,0,0,0,0,0,0,0}, 00029 {0,1,0,0,0,0,0,1}, 00030 {0,1,1,1,1,1,1,1}, 00031 {0,1,0,0,0,0,0,1}, 00032 {0,0,0,0,0,0,0,0}, 00033 {0,0,0,0,0,0,0,0}, 00034 {0,0,0,0,1,1,1,0}, 00035 {0,0,0,1,1,1,1,1}, 00036 {0,0,1,1,1,1,1,1}, 00037 {0,1,1,1,1,1,1,0}, 00038 {0,0,1,1,1,1,1,1}, 00039 {0,0,0,1,1,1,1,1}, 00040 {0,0,0,0,1,1,1,0}, 00041 {0,0,0,0,0,0,0,0}, 00042 {0,0,0,0,0,0,0,0}, 00043 {0,0,1,1,1,1,1,1}, 00044 {0,1,0,0,0,0,0,0}, 00045 {0,1,0,0,0,0,0,0}, 00046 {0,0,1,1,1,1,1,1}, 00047 {1,0,0,0,0,0,0,0} 00048 }; 00049 00050 int pos = 0; 00051 int i = 0; 00052 00053 int main() { 00054 sw.mode(PullUp); 00055 00056 while(1){ 00057 00058 if(sw.read() == 0) { 00059 wait(0.006); // 6ms 00060 pos = 0; 00061 00062 while(bitmap[++pos][0] != 1) { 00063 led1.write(bitmap[pos][1]); 00064 led2.write(bitmap[pos][2]); 00065 led3.write(bitmap[pos][3]); 00066 led4.write(bitmap[pos][4]); 00067 led5.write(bitmap[pos][5]); 00068 led6.write(bitmap[pos][6]); 00069 led7.write(bitmap[pos][7]); 00070 00071 wait(0.002); // 2ms 00072 } 00073 00074 // LED off 00075 led1.write(0); 00076 led2.write(0); 00077 led3.write(0); 00078 led4.write(0); 00079 led5.write(0); 00080 led6.write(0); 00081 led7.write(0); 00082 } 00083 } 00084 }
Generated on Wed Jul 13 2022 23:06:04 by
1.7.2