![](/media/cache/profiles/d8f2cfaf0001e1a2b669a0e0a0b924b1.jpg.50x50_q85.png)
LT-5016M1を74HC595で制御します。文字スクロールなどの参考にどうぞ。
制作の過程はNotebookに書いています。
Diff: main.cpp
- Revision:
- 15:5cec652070ca
- Parent:
- 13:83c703e6e843
- Child:
- 16:cd36324730ad
--- a/main.cpp Mon Sep 26 03:07:22 2016 +0000 +++ b/main.cpp Mon Sep 26 16:05:55 2016 +0000 @@ -91,23 +91,11 @@ // 表示パターン送り込み for(int i=0; i<4*11; i++){ - if(round < 250) { - spi.write(0b10101010); - } else { - spi.write(0b01010101); - } + spi.write(0b00000001 << round/100); } - spi.write(0); - spi.write(0); - spi.write(0); - spi.write(0); - spi.write(0); - spi.write(0); - spi.write(0); - spi.write(0); // スクロール - if(round > 500) { // スクロール速度 + if(round > 800) { // スクロール速度 scroll++; // 1ドットスクロールする round = 0; // スキャン周回カウントリセット } @@ -125,12 +113,13 @@ while(timer.read_us()<0) { // 数字のぶんだけ暗くする wait_us(10); } - G = !BUTTON; // ボタン押すと消灯 + G = BUTTON; // ボタン押すと/*消*/灯 // ダイナミック点灯のパルス幅を決める while(timer.read_us()<100) { // 100*2500でゆっくり wait_us(10); } -// pc.printf("%f\r\n", timer.read()); +// pc.printf("%d\r\n", timer.read_us()); +// pc.printf("%d\r\n", round/100); } }