create every day - 福野泰介の一日一創

Micro Dot pHAT controlled by IchigoJam I2C

2017/03/12 23:55:00
#IchigoJam #KidsIT #maker #english 

I bought a "Micro Dot pHAT by PIMORONI" showed me at Raspberry Jam by Akkie-san.
IchigoJam can control this also using the adapter board to HAT (Sense HAT).

6 matrix LEDs are controlled by IS31FL3730.
These I2C address are #61/#62/#63. Each IC connects to 2 matrix LEDs difference directions (@A pattern / @B pattern on the following BASIC source code).

1 'MICRO DOT pHAT for IchigoJam BASIC 1.2.1 10 GSB@INIT 20 S=" HELLO! WoT ":M=0 30 FOR P=0 TO 5 40 C=PEEK(S+P+M):GSB@PUTC 50 NEXT:GSB@UPDATE:M=(M+1)%(LEN(S)-5):GOTO 30 60 END 100 @INIT 110 FOR I=#61 TO #63 120 POKE#800,0,`11000:IF I2CW(I,#800,2,#800,0) STOP 130 POKE#800,#D,`1110:IF I2CW(I,#800,2,#800,0) STOP 140 POKE#800,#19,30:IF I2CW(I,#800,2,#800,0) STOP 150 NEXT 160 RTN 200 @PUTC:'P=pos0-5,C=char 210 A=#63-P/2:IF P&1 GSB@A ELSE GSB@B 230 RTN 300 @A 310 FOR I=0 TO 6 320 D=PEEK(C*8+I)>>2:N=0 330 FOR J=0 TO 4 340 N=N+D&1<<(4-J):D=D>>1 350 NEXT 360 POKE#700+I,N 370 NEXT 380 POKE#800,1:IF I2CW(A,#800,1,#700,7) STOP 390 RTN 400 @B 410 FOR I=0 TO 4 420 N=0 430 FOR J=0 TO 6 440 N=N+PEEK(C*8+J)>>(6-I)&1<<J 450 NEXT 460 POKE#700+I,N 470 NEXT 480 POKE#800,#E:IF I2CW(A,#800,1,#700,5) STOP 490 RTN 500 @UPDATE 510 FOR A=#61 TO #63:POKE#700,#C,1:IF I2CW(A,#700,2,#700,0) STOP 520 NEXT:RTN

Try to modify!
First of all, it's very easy to change the message on line 20!

Next I want to try to control "Rainbow HAT" for Android Things by Google!

links
- the code of Sense HAT
- the code of Micro Dot pHAT
- Rainbow HAT
- Raspberry Pi Boards, Kits, HATs, and Accessories - Next Day Delivery - Pimoroni

Tweet
クリエイティブ・コモンズ・ライセンス
この作品は「Creative Commons — CC BY 4.0」の下に提供されています。
CC BY 福野泰介 - Taisuke Fukuno / @taisukef / high-res profile image