Hi!
I try to use display, simple 7-segment with micro 16f688. I want display show numbers from 0 to 9.
have big problem when the display come to last number then the display show random number.
Code:
#chip 16F688, 4
#config HS_OSC, WDT_OFF
dim NumArray(10)
NumArray= 0b0111111,0b0000110,0b1011011,0b1001111,0b1100110,0b1101101,0b1111101,0b0000111,0b1111111,0b1101111
dim i as Byte
do
for i=0 to 9
PORTc=NumArray(i)
porta.2=NumArray(i).6
wait 1000 ms
next i
loop
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
#chip 16F688, 4
#config HS_OSC, WDT_OFF
dim NumArray(10)
NumArray= 0b0111111,0b0000110,0b1011011,0b1001111,0b1100110,0b1101101,0b1111101,0b0000111,0b1111111,0b1101111
dim ii as Byte
do
for ii=1 to 10
PORTc=NumArray(ii)
porta.2=NumArray(ii).6
wait 1000 ms
next ii
loop
Also, look up '7 Segment Displays Overview' in Help - this may help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
I try to use display, simple 7-segment with micro 16f688. I want display show numbers from 0 to 9.
have big problem when the display come to last number then the display show random number.
Code:
#chip 16F688, 4
#config HS_OSC, WDT_OFF
dim NumArray(10)
NumArray= 0b0111111,0b0000110,0b1011011,0b1001111,0b1100110,0b1101101,0b1111101,0b0000111,0b1111111,0b1101111
dim i as Byte
do
for i=0 to 9
PORTc=NumArray(i)
porta.2=NumArray(i).6
wait 1000 ms
next i
loop
The Array index is held in byte 0 - see the Help.
Does this work?
Also, look up '7 Segment Displays Overview' in Help - this may help.