I recently picked up a TI-Innovator Hub and finally decided to do something with it, since I haven't seen many people use it much at all.

I wrote a driver for 8x8 LED matrix displays using the MAX7219 chip. You can find matrix displays with this chip already soldered to a board on Amazon for $9 here. The driver is written purely in TI-BASIC and can be controlled through TI-BASIC. Here is code utilizing the driver that displays a smiley face on 8x8 display:

Code:
ClrHome
Disp "Starting display..."
"S":prgmEBED

Disp "Dimming display..."
"I0":prgmEBED

Disp "Drawing to display.."
"D"
Ans+"00000000"
Ans+"00100100"
Ans+"00100100"
Ans+"00100100"
Ans+"10000001"
Ans+"01000010"
Ans+"00111100"
Ans+"00000000"
prgmEBED

Disp "Shutting down display..."
"E":prgmEBED


The driver works by having you pass strings into it. I called it "EBED" for "eight-by-eight display".

The first character of the string represents a specific command, and then any following characters are the input for the command. The "S" command means "start/boot up the display". The "I" command lets you set the display's intensity (aka brightness), and can take values 0-7. The "D" command draws a 64 bit buffer of 0s and 1s to the display. The "E" command shuts down the display.

There's also the "W" command that writes 16 bits into MAX7219 chip's internal register, and the "B" command that converts an integer to a 16-bit binary value. These are mainly used by the driver itself and you don't really need to worry about them.

Here's a video of the above code running:


As you can see, it's pretty slow, I can't really do much about TI-BASIC's slowness. The TI-Innovator Hub requires the use of TI-BASIC.

Here's the actual code for the driver:

Code:
Ans->Str0
sub(Str0,1,1)->Str1

If Str1="W"
Then
   For(I,2,length(Str0))
      If sub(Str0,I,1)="0"
      Then
         Send("SET BB3 OFF")
         Else
         Send("SET BB3 ON")
      End
      Send("SET BB1 ON")
      Send("SET BB1 OFF")
   End
   Send("SET BB2 ON")
   Send("SET BB2 OFF")
   Return
End

If Str1="S"
Then
   Send("SET BB1 OFF")
   Send("SET BB2 OFF")
   Send("SET BB3 OFF")
   
   "W0000101100000111"
   prgmEBED
   "W0000100100000000"
   prgmEBED
   "W0000110000000001"
   prgmEBED
   "W0000111100000000"
   prgmEBED
   Return
End

If Str1="B"
Then
   "B"->Str1
   expr(sub(Str0,2,length(Str0)-1))->S
   For(I,1,8)
      remainder(S,2)->V
      If V=0
      Then
         "0"+Str1->Str1
         Else
         "1"+Str1->Str1
      End
      (S-V)/2->S
   End
   sub(Str1,1,8)->Str1
   Return
End

If Str1="I"
Then
   "B"+sub(Str0,2,length(Str0)-1)
   prgmEBED
   "W00001010"+Ans
   prgmEBED
   Return
End

If Str1="D"
Then
   sub(Str0,2,64)->Str3
   For(K,1,8)
      "E"->Str2
      For(L,0,7)
         sub(Str3,K+L*8,1)+Str2->Str2
      End
      sub(Str2,1,8)->Str2
      "B"+toString(K)
      prgmEBED
      "W"+Ans+Str2
      prgmEBED
   End
   Return
End

If Str1="E"
Then
   "W0000110000000000"
   prgmEBED
   Return
End


The driver expects CLK to be BB1, CS to be BB2, and DIN to be BB3.
The driver is based off the data sheet here.
Neat, but the awful speed is disappointing. Looks like you could claw back a little bit of it by optimizing the write loop to only SET BB3 if the new state differs from the previous one though..

I've built something with a similar LED matrix, but driven with an HT16K33 attached to an AVR:


Have you considered making it run a Game of Life?
Is there anyway to use the Innovator hub through assembly language? Are there ROM call routines?

I'm just starting assembly programming on a TI-84 calculator...
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement