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.
Dependencies: mbed
Revision 0:ee70667e2819, committed 2015-11-21
- Comitter:
- spyglass77
- Date:
- Sat Nov 21 16:47:11 2015 +0000
- Commit message:
- Matrix mark
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 |
diff -r 000000000000 -r ee70667e2819 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Nov 21 16:47:11 2015 +0000 @@ -0,0 +1,80 @@ +#include "mbed.h" +/* +マトリックス・サンプルプログラム +Ver.112201 +Rows(dp24, dp25, dp26, dp2, dp28, dp17, dp18, dp1):データ +Cpin( 13, 3, 4, 10, 6, 11, 15, 16):カソード + +Cols(dp13, dp14, dp4, dp16, dp6, dp9, dp10, dp11):制御 +Apin( 9, 14, 8, 12, 1, 7, 2, 5):アノード +*/ + + BusOut Rows (dp24, dp25, dp26, dp2, dp28, dp17, dp18, dp1); + BusOut Cols (dp13, dp14, dp4, dp16, dp6, dp9, dp10, dp11); + DigitalOut myled(dp15); + +int DotPattern[] = {0x00, //00000000//空データ + 0x00, //00000000 + 0x00, //00000000 + 0x00, //00000000 + 0x00, //00000000 + 0x00, //00000000 + 0x00, //00000000 + 0x00, //00000000 + + 0x18, //00011000//マーク + 0x3c, //00111100 + 0x7e, //01111110 + 0xff, //11111111 + 0xdb, //11011011 + 0x99, //10011001 + 0x18, //00011000 + 0x18, //00011000 + + 0x00, //00000000//空データ + 0x00, //00000000 + 0x00, //00000000 + 0x00, //00000000 + 0x00, //00000000 + 0x00, //00000000 + 0x00, //00000000 + 0x00, //00000000 + }; +float count; +float timer; +int offset; +int linecls; +int loop; +int index; + +int main() { + while (1) { + myled = 1; + + //初期化(Matrixリセット) + index =1; + for(linecls = 1; linecls<=8; linecls++){ + Cols = (index); + Rows = 0x00; + index = index*2; + } + //2行目から読み込む、マークの一文字だけ表示あとは順次インクリメント + offset = 2; + count =1; + while (count < 24) { + timer = 1; + while (timer < 5000) { + index = 1; + for(loop =0; loop<=7; loop++) { + Cols = index; + Rows = DotPattern[offset + loop]; + index = index*2; + } + timer++; //タイマー処理中ループ + } + offset++; + count++; + myled =!myled; + } + } +} \ No newline at end of file
diff -r 000000000000 -r ee70667e2819 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Nov 21 16:47:11 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11 \ No newline at end of file