Aliexpressなどで販売されている64x32のフルカラードットマトリクスLED2枚とNucleo F401REを利用して、 E233系の駅停車時、路線名表示ありのLED側面行先表示を再現するプログラムです。 3秒間隔、3段階切替で、路線名、種別、行先、次停車駅を個別に指定することが可能です。
Dependencies: SDFileSystem mbed
Diff: main.cpp
- Revision:
- 16:d02248f44c4b
- Parent:
- 15:12895e9c6965
- Child:
- 17:95bcbc53d96b
--- a/main.cpp Fri Nov 14 19:08:32 2014 +0000 +++ b/main.cpp Fri Nov 14 22:51:39 2014 +0000 @@ -206,20 +206,22 @@ //10 Yellow(Nambu Local) //11 Green (Yokohama Line) //12 Orange(Rapid Acty,Urbun) -bool R1Data1[32]={0,1,0,0,1,0,1,1,0,1,1,1,1,0,1,1}; -bool R1Data2[32]={0,1,0,0,1,0,1,1,0,1,1,0,1,0,0,0}; -bool R1Data3[32]={0,1,0,0,1,0,1,1,0,1,1,0,1,0,0,0}; -bool R1Data4[32]={0,1,0,0,1,0,1,1,0,1,0,0,1,0,0,0}; + +//16 Green(Utsunomiya Line) +bool R1Data1[32]={0,1,0,0,1,0,1,1,0,1,1,1,1,0,1,1,0}; +bool R1Data2[32]={0,1,0,0,1,0,1,1,0,1,1,0,1,0,0,0,0}; +bool R1Data3[32]={0,1,0,0,1,0,1,1,0,1,1,0,1,0,0,0,0}; +bool R1Data4[32]={0,1,0,0,1,0,1,1,0,1,0,0,1,0,0,0,0}; -bool G1Data1[32]={0,0,1,0,1,1,0,1,1,0,1,1,1,1,0,1}; -bool G1Data2[32]={0,0,1,0,1,1,0,1,1,0,1,1,0,0,0,0}; -bool G1Data3[32]={0,0,1,0,1,1,0,1,0,0,0,0,0,0,0,0}; -bool G1Data4[32]={0,0,1,0,1,1,0,1,0,0,0,0,0,0,0,0}; +bool G1Data1[32]={0,0,1,0,1,1,0,1,1,0,1,1,1,1,0,1,1}; +bool G1Data2[32]={0,0,1,0,1,1,0,1,1,0,1,1,0,0,0,0,1}; +bool G1Data3[32]={0,0,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0}; +bool G1Data4[32]={0,0,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0}; -bool B1Data1[32]={0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1}; -bool B1Data2[32]={0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0}; -bool B1Data3[32]={0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0}; -bool B1Data4[32]={0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0}; +bool B1Data1[32]={0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1,0}; +bool B1Data2[32]={0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,0}; +bool B1Data3[32]={0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,0}; +bool B1Data4[32]={0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,0}; @@ -418,7 +420,7 @@ //wait_us(10); OE = LOW; // Enable output - wait_us(10); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh. + wait_us(15); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh. } //2 for(int Row=0; Row<LED_Height; Row++) { @@ -428,7 +430,7 @@ //wait_us(10); OE = LOW; // Enable output - wait_us(10); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh. + wait_us(15); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh. } //3 for(int Row=0; Row<LED_Height; Row++) { @@ -437,7 +439,7 @@ //wait_us(10); OE = LOW; // Enable output - wait_us(10); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh. + wait_us(15); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh. } //4 for(int Row=0; Row<LED_Height; Row++) { @@ -446,7 +448,7 @@ //wait_us(10); OE = LOW; // Enable output - wait_us(10); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh. + wait_us(15); // Wasting some time. Use for whatever else. Probably better with a ticker for the display refresh. } } @@ -487,7 +489,7 @@ pc.printf("SDFileOpen Success %s\r\n",SDFilePath); //SDDataReadtest - int Data; + int8_t Data; for(int y = Starty; y < Starty + Ready; y++){ for(int x = Startx; x < Startx + Readx; x++){ Data = getc(fp); @@ -540,12 +542,15 @@ //SDCard - SDFilePath = "/sd/E233/Kind/1.bin"; + SDFilePath = "/sd/E233/Kind/2.bin"; SDBufferWrite(LEDBuffer,0,0,48,32); SDFilePath = "/sd/E233/For/1.bin"; SDBufferWrite(LEDBuffer,48,0,80,16); + SDFilePath = "/sd/E233/Line/37.bin"; + SDBufferWrite(LEDBuffer,48,0,80,32); + SDFilePath = "/sd/E233/NextStation/1.bin"; SDBufferWrite(LEDBuffer,48,16,80,16);