how to declare a variable in bascom

Discussion in 'General Electronics Chat' started by arwa hawwa, Aug 13, 2014.

  1. arwa hawwa

    Thread Starter New Member

    Jul 13, 2014
    6
    0
    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
     
  2. arwa hawwa

    Thread Starter New Member

    Jul 13, 2014
    6
    0
    replay to me please
     
  3. Jony130

    AAC Fanatic!

    Feb 17, 2009
    3,957
    1,097
    Code ( (Unknown Language)):
    1.  
    2. $regfile = "m32def.dat"
    3.  
    4. Dim Variable As Byte
    5.  
    6. CONFIG  PORTB.0 = INPUT
    7. CONFIG  PORTC.0 = OUTPUT
    8.  
    9. Do
    10. If Pinb.0 = 1 then
    11. Waitms 50
    12. End If
    13. If Pinb.0 = 1 then
    14. Incr Variable
    15. End If
    16.  
    17. If variable = 30 then
    18. PORTC.0 = 1
    19. End If
    20.  
    21. Loop
    22. End
    23.  
    But this program is pointless
     
Loading...