Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
For information only, I just experimented with the MSB and LSB but didn't catch the fact that one of the arrays had two bits enabled which threw me for a loop until I realized it.
Apparently JonSea or ?? didn't read the post that I was experimenting by changing the MSB to LSB just to satisfy my curiosity.
ITS CALLED LEARNING BY DOING.
No he didn't but I bet he does now see what it does! Give him a break here Jon this is his hobby and you know what looks like your hobby is writing what's wrong with MrDebExperimenting is good...randomly changing stuff isn't experimenting.
Did you consider what should happen when you changed from MSB first to LSB first? I suspect not.
{
*****************************************************************************
* Name : UNTITLED.BAS *
* Author : [select VIEW...EDITOR OPTIONS] *
* Notice : Copyright (c) 2012 [select VIEW...EDITOR OPTIONS] *
* : All Rights Reserved *
* Date : 11/12/2012 *
* Version : 1.0 *
* Notes : Burts knight rider *
* : *
*****************************************************************************
}
Device = 18F2420
Clock = 16
Config OSC = INTIO67
Include "InternalOscillator.bas "
Include "shift.bas"
Include "utils.bas"
Include "convert.bas"
Include "InternalOscillator.bas "
Dim SDI As PORTC.4
Dim CLK As PORTC.5
Dim LE As PORTC.3
Dim RED_OE As PORTC.0
Dim GREEN_OE As PORTC.1
Dim DataPin As SDI
Dim ClockPin As CLK
Dim ResetPin_R As RED_OE
Dim ResetPin_G As GREEN_OE
Dim index As Byte
Dim X As Byte
Dim row0 As PORTb.0
Dim row1 As PORTb.6
Dim row2 As PORTB.1
Dim row3 As PORTB.2
Dim row4 As PORTB.3
Dim row5 As PORTB.4
Dim row6 As PORTB.5
Dim led As PORTA.0
dim R_ow as word
dim colum_buffer(5) as byte
Dim Z As Byte
Const data(5)As Byte =(%00001001, %000001010 ,%00000100, %00001000, %00011111)
Const Rows(7) As Byte =(%00001001, %000000010 ,%00000100, %00001000, %00100000, %01000000, %00000000)
sub LOAD()
for z = 0 to 4 // trying to build an array using the CONST data
colum_buffer(Z)= data(z)
next
end sub
Sub StartScan()
LE = 0
ResetPin_G = 1
Shift.Out(mSB_FIRST, colum_buffer(x) ,8) // want to incorporate the CONST data here
LE = 1 //Latch data
high( portb.0)
DelaymS(1000)
ResetPin_G = 0 // output disable
LE = 0
End Sub
Shift.SetOutput(DataPin)
Shift.SetClock(ClockPin)
ADCON1 = $07
Output(ResetPin_R)
Output(ResetPin_G)
Output (LE)
//trisc=%00000000
//trisb=%00000000
//Output(row0)
//Output(row1) // enable row1
//Output(row2)
//Output(row3)
//Output(row4)
//Output(row5) // enable row1
//Output (row6)
While true
{
For index = 0 To Bound (data)
DelayMS(500)
X = (data(index)
}
load
StartScan
// High(row0)
// High(row1) // enable row1
// High(row2)
// High(row3)
// High(row4)
// High(row5) // enable row1
// High(row6)
Wend
End