Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 7 months ago.
LEDマトリクスでの複数パターン表示方法
LEDマトリクスを使って、複数のパターンを順に点灯させたいのですが どのようにプログラムを組めばよいか全く分からず、教えて頂けないでしょうか。 現状、1パターンを点灯させる事はできましたが、次の別パターンに移るところで 躓いています。
[code]
- include "mbed.h"
Ticker flipper; BusOut Col(dp3,dp6,dp7,dp8,dp9,dp10,dp11,dp12); BusOut Row(dp15,dp16,dp17,dp18,dp19,dp20,dp21,dp22);
const uint8_t pt[8] = {0x80,0x10,0x44,0x20,0x04,0x90,0x08,0x00};
void flip() { static int col = 0;
Row = 0; Col = pt[col]; Row = 1 << col;
col++; col %=8; }
int main() { flipper.attach(&flip,0.02);
while(1) { } }
[/code]