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.
No.
This chart shows the Vf of the matrices you have for your little blinker project. It can be as high as 5 volts.
View attachment 87484
{
*****************************************************************************
* Name : UNTITLED.BAS *
* Author : [select VIEW...EDITOR OPTIONS] *
* Notice : Copyright (c) 2014 [select VIEW...EDITOR OPTIONS] *
* : All Rights Reserved *
* Date : 7/21/2014 *
* Version : 1.0 *
* Notes : Using the MAX7219 kit from Ebay and Tap 28 w/ crystal *
* : *
*****************************************************************************
}
DEVICE = 18F2420
CLOCK = 20
INCLUDE "shift.bas"
INCLUDE "utils.bas"
INCLUDE "convert.bas"
' INCLUDE "DS18B20.bas"
INCLUDE "Utils.bas"
DIM Loadpin AS PORTC.3 // LATCH
DIM Datapin AS PORTC.4 // DATA
DIM Clockpin AS PORTC.3 // CLOCK
DIM count AS BYTE
DIM X AS BYTE
DIM index AS BYTE
CONST Anodes(32)AS BYTE = (%00000001, %00000010, %00000100, %00001000, %00010000,%00000001, %00000010, %00000100,
%00001000, %00010000, %00100000, %01000000, %10000000,%00100000, %01000000, %10000000,
%00000001, %00000010, %00000100, %00001000, %00010000,%00000001, %00000010, %00000100,
%00001000, %00010000, %00100000, %01000000, %10000000,%00100000, %01000000, %10000000)
CONST Cathodes(2) AS BYTE = (%11111111, %00000000)
SUB RIGHT()
DIM index AS BYTE
DIM X AS BYTE
FOR index = 0 TO BOUND (Anodes)
Loadpin = 0
' DELAYuS(100)//10 500us for constant on
X = Anodes(index)
Shift.Out(MSB_FIRST, X ,8)
DELAYUS(20) //20 us
NEXT
END SUB
// start of main
SetAllDigital
Shift.SetOutput(DataPin) // data out pin (RC4)
Shift.SetClock(ClockPin) // shift reg clock (RC5)
loadpin = 0 // make output and set low
TRISB = %00000000 // make PORTB outputs
TRISC = %00000000 // make PORTC as outputs
OUTPUT(loadpin)
WHILE true
RIGHT()
WEND
END
...Well here is the code I am working with but feel I am missing something??...
LED_Data = %10101010
LED_Reg = 1
WriteLED
....Deciphering the code you posted and the one you used for a 7 seg display both have the line of code with
Data_Out = 256* LED_Reg + LED_Data.
am I interrupting this as the method to input the option registers then the data desired?....
InitLED 'sets up the registers
While 1 = 1
LED_Reg = 1
LED_Data = %00000001
WriteLED
LED_Reg = 2
LED_Data = %00000010
WriteLED
LED_Reg = 3
LED_Data = %00000100
WriteLED
LED_Reg = 4
LED_Data = %00001000
WriteLED
LED_Reg = 5
LED_Data = %00010000
WriteLED
LED_Reg = 6
LED_Data = %00100000
WriteLED
LED_Reg = 7
LED_Data = %01000000
WriteLED
LED_Reg = 8
LED_Data = %10000000
WriteLED
DelayMS(1000)
ClearLED
DelayMS(1000)
Wend