Here is my compiled code.
Code:
@ __CONFIG _XT_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF &_BODEN_OFF
TRISA = %11111111 ' Set PORTA to all input
ADCON1 = %10000010 ' Set PORTA analog and right justify
CMCON = %00000111 'comparators off
TRISC.3 = 0 'clock
TRISC.4 = 0 'chip select active low
TRISC.5 = 0 'data
RPM VAR WORD
IPS VAR WORD
clock VAR PORTC.3
sdata VAR PORTC.5
INCLUDE "NKK.pbp"
Include "modedefs.bas"
shiftout clock,sdata,MSBFIRST,[$40] 'led color command
shiftout clock,sdata,MSBFIRST,[%00111011] 'teal
shiftout clock,sdata,MSBFIRST,[$41] 'led bright command
shiftout clock,sdata,MSBFIRST,[%11111111] 'full bright
Initialize:
NKKmode = 6 ; 4x5 mode
@ NKKclear ; clear the NKK screen buffer
@ NKKtext (1,1,"RPM:") ; row 1, column 1
@ NKKtext (3,1,"IPS:") ; row 3, column 1
@ NKKtext (4,2,"0.") ; row 4, column 2
;----[ The Main Loop ]------------------------------------------------------
Main:
@ NKKword (2,2,4,right,RPM) ; Display RPM
@ NKKword (4,4,2,zeros,IPS) ; Display IPS
@ NKKupdate ; Send data to the display
RPM = RPM + 10
IPS = IPS + 2
PAUSE 1000
GOTO Main
;----[ Send Command to start Display Data Transfer ]------------------------
NKKstartData:
shiftout clock,sdata,MSBFIRST,[$55] 'xfer data command
; *** this subroutine should send the $55 command ***
RETURN
;----[ Send 1 byte to the NKK display ]-------------------------------------
NKKsendByte:
shiftout clock,sdata,MSBFIRST, [1]
; *** this subroutine should send one byte at a time ***
; *** The byte to send is in the variable OutByte ***
; *** Send the data MSB first ***
RETURN
What displays is 8 vertical lines, each 1 pixel wide. How many bytes should be sent in that last subroutine? Many thanks again for your time and help.
Bookmarks