this is a very simple example shows how to drive 4-digits 7-segment display with MAX7219 and rLedControl library, this code example displays 'HoLA' word, you can add more digits and MAX7219 devices.
each MAX device can drive up to 8 7-segment digits.
33K ohm resistor should be connected between pin 18(ISET) and pin 19(V+) of MAX7219, not shown in provided datasheet.
datasheet and connection links below.
7-Segment display datasheet
MAX7219 datasheet and connection
each MAX device can drive up to 8 7-segment digits.
33K ohm resistor should be connected between pin 18(ISET) and pin 19(V+) of MAX7219, not shown in provided datasheet.
datasheet and connection links below.
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public Serial1 As Serial
Private Sg As LedControl
'33Kohm resistor should be connected between pin 18(ISET) and pin 19(V+) of MAX7219
'CNQ-3641 4 digits 7-segment display module used(com cathode)
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
Sg.Initialize(12,11,10,1)
Sg.Shutdown(0,False)
Sg.SetIntensity(0,8)
Sg.SetScanLimit(0,4) '
Sg.ClearDisplay(0)
RunTest
End Sub
private Sub RunTest()
Sg.SetChar(0,0,"H",False)
Sg.SetChar(0,1,"o",False)
Sg.SetChar(0,2,"L",False)
Sg.SetChar(0,3,"A",False)
End Sub
MAX7219 datasheet and connection