Menu

I need help with this

Help
2008-11-18
2013-05-30
  • Nobody/Anonymous

    here is the piece that gives me lots of errors:
    #chip 16F685, 4 'mhz
    #config OSC=INTOSC, MCLRE=off, WDT=off

    'Set the pin directions
    dir porta.3 in 'switch
    dir portc.3 out ' RED

    'Main routine
    Start:
    if porta.3 on then flash
    goto start

    sub flash
    set portc.3 on ' RED
    wait 250 ms
    set portc.3 off ' RED
    end sub

     
    • kent_twt4

      kent_twt4 - 2008-11-18

      If your 'switch' is actually a momentary button then porta.3 is O.K.  The MCLR  button will produce a momentary low, so change the conditional statement, and debounce as required:

      Start:
      if porta.3 off then
      wait 10 ms
      If porta.3 on then goto start
      flash
      end if
      ....
      ....

       
      • Nobody/Anonymous

        When I compile it I get a sytax error, and a syslcdtemp.0 is not a vaild i/o pin or port error for every line that has the "
        if porta.3 on then flash" statement,
        try to compile the code i posted in my first post and see

         
    • kent_twt4

      kent_twt4 - 2008-11-18

      Now that my eyes are open, its the sub 'flash' that needs to be changed to a different name (it's being used by the lowlevel lcd.h file).

       
      • Nobody/Anonymous

        that did it, thanks

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.