Re: 12F683 - basic code not working
Hi, Malc
I would have written ...
Code:
ASM
__CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF
endasm
TRISIO = %00111110
ANSEL = 0
GPIO.0 = 0
CMCON0=7
Motor var GPIO.0
Switch1 var GPIO.1
Switch2 var GPIO.2
main:
If !Switch1 then
demo:
high Motor
pause 1000
low Motor
pause 1000
endif
goto main
but it's just me ...
at least, your "endif" should be placed just before the " demo " label ...
cause the " IF " condition never sees the " ENDIF " condition reset ....
tadaaaaaa ... 
Alain
Last edited by Acetronics2; - 14th January 2014 at 20:58.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks