vali khandangoll
Active Member
hi all of you.
i want to use a 7 segment with IC 74HC595.
Everything works fine when I replace the LED and 7 segment.
but when i use 7 segment does not work Properly.
my code is below
Sub Process_Globals
Public Serial1 As Serial
Private datapin, latchpin, clockpin As Pin
Private Registers(8) As Boolean
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
datapin.Initialize(8, datapin.MODE_OUTPUT)
latchpin.Initialize(9, latchpin.MODE_OUTPUT)
clockpin.Initialize(10, clockpin.MODE_OUTPUT)
Delay(3000)
Dim j As Int
Do While 1=1
For j=0 To 7
' LED is turning on
Registers(j) = True
UpdateRegister(j)
Delay(1000)
Next
'LED is turrning off
For j=0 To 7
Registers(j) = False
UpdateRegister(j)
Delay(1000)
Next
Loop
Log("Finished")
End Sub
Private Sub UpdateRegister(segment_no)
latchpin.DigitalWrite(False)
clockpin.DigitalWrite(False)
datapin.DigitalWrite(Registers(segment_no))
Delay(10)
clockpin.DigitalWrite(True)
Delay(10)
latchpin.DigitalWrite(True)
Delay(1)
End Sub
i want to use a 7 segment with IC 74HC595.
Everything works fine when I replace the LED and 7 segment.
but when i use 7 segment does not work Properly.
my code is below
Sub Process_Globals
Public Serial1 As Serial
Private datapin, latchpin, clockpin As Pin
Private Registers(8) As Boolean
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
datapin.Initialize(8, datapin.MODE_OUTPUT)
latchpin.Initialize(9, latchpin.MODE_OUTPUT)
clockpin.Initialize(10, clockpin.MODE_OUTPUT)
Delay(3000)
Dim j As Int
Do While 1=1
For j=0 To 7
' LED is turning on
Registers(j) = True
UpdateRegister(j)
Delay(1000)
Next
'LED is turrning off
For j=0 To 7
Registers(j) = False
UpdateRegister(j)
Delay(1000)
Next
Loop
Log("Finished")
End Sub
Private Sub UpdateRegister(segment_no)
latchpin.DigitalWrite(False)
clockpin.DigitalWrite(False)
datapin.DigitalWrite(Registers(segment_no))
Delay(10)
clockpin.DigitalWrite(True)
Delay(10)
latchpin.DigitalWrite(True)
Delay(1)
End Sub