It mirrors the VGA display to the DMD....It just ping pongs the text across the screen.....

My code (2.54 Kb)
Code: Select all
Option base 0
DMD_A = 16 ' D6 from etherten(arduino)
DMD_B = 15 ' D7 from etherten(arduino)
DMD_OE = 14 ' D9 from etherten(arduino)
DMD_CLK = 20 ' D13 from etherten(arduino)
DMD_SCLK = 17 ' D8 from etherten(arduino)
DMD_R_Data = 19 ' D11 from etherten(arduino)
DMD_T_Data = 18 ' D12 from etherten(arduino)
Pin(DMD_A) = 0
SetPin DMD_A , 8
Pin(DMD_B) = 0
SetPin DMD_B , 8
Pin(DMD_OE) = 0
SetPin DMD_OE , 8
Pin(DMD_CLK) = 0
SetPin DMD_CLK , 8
Pin(DMD_SCLK) = 0
SetPin DMD_SCLK , 8
Pin(DMD_R_Data) = 1
SetPin DMD_R_Data , 8
SetPin DMD_T_Data , 2
DisplaysWide=1
DisplaysDown=1
Cls
Dim row(17,4)
videomem= MM.Video ' code added to MMBasic source 3.2 by D Wyatt
videomemlo = videomem And &h0000ffff
videomemhi = ((videomem-videomemlo)\2^16) And &h0000ffff
direction = 1
timing = 85
Timer=0
Do
text$=Inkey$
If text$="q" Then End
nextmove=Timer
If nextmove >lastmove + timing Then
Line (xpos,0)-(xpos,16),0
xpos=xpos+direction
If xpos>30 Or xpos<1 Then direction = -direction
Print@(xpos,0) "Maxi"
Print@(xpos,8) "mite"
lastmove=nextmove
EndIf
senddata1(0,0,1)
senddata1(1,0,2)
senddata1(0,1,3)
senddata1(1,1,0)
Loop
Sub senddata1( a_pin , b_pin , displayrow)
lastTimer =Timer
For y= displayrow To 15 Step 4
row(y,4)=Peek(videomemhi,videomemlo+60*y) Xor &hff
row(y,3)=Peek(videomemhi,videomemlo+60*y+1) Xor &hff
row(y,2)=Peek(videomemhi,videomemlo+60*y+2) Xor &hff
row(y,1)=Peek(videomemhi,videomemlo+60*y+3) Xor &hff
Next y
' Print@(10,200) Timer
Pin(DMD_A)= a_pin
Pin(DMD_B)= b_pin
Pin(DMD_OE) = 1
For showbits = 1 To 4
junk1 = SPI(DMD_T_Data, DMD_R_Data, DMD_CLK, row(12+displayrow,showbits)*2^8+row(8+displayrow,showbits), H, 0, 16)
junk1 = SPI(DMD_T_Data, DMD_R_Data, DMD_CLK, row(4+displayrow,showbits)*2^8+row(displayrow,showbits), H, 0, 16)
Next showbits
Pin(DMD_OE) = 0
Pin(DMD_SCLK) = 1
Pin(DMD_SCLK) = 0
Print@(20,220) Timer-lasttimer
End Sub
Cheers Dennis