how to declare a variable in bascom

Thread Starter

arwa hawwa

Joined Jul 13, 2014
6
i need to do this statment
if portb.0 = 1
then
"the variable " = +1

and if the variable = 30
then portc.0 = 1

how could i make it
 

Jony130

Joined Feb 17, 2009
5,487
Rich (BB code):
$regfile = "m32def.dat"

Dim Variable As Byte

CONFIG  PORTB.0 = INPUT
CONFIG  PORTC.0 = OUTPUT

Do
If Pinb.0 = 1 then
Waitms 50
End If
If Pinb.0 = 1 then
Incr Variable
End If

If variable = 30 then
PORTC.0 = 1
End If

Loop
End
But this program is pointless
 
Top