Re: syntax for loop delay with 12F629?
This one should work ... ( ISIS tells so ...
)
Code:
'****************************************************************
'* Name : SERVOTEST0 *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2013 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 10/02/2013 *
'* Version : 1.0 *
'* Notes : 12F629 @4 Mhz internal *
'* : *
'****************************************************************
#CONFIG
__config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _CP_OFF & _MCLRE_OFF
#ENDCONFIG
Servo var GPIO.0
Right var GPIO.1
Left var GPIO.2
Define OSCCAL_1K 1
CMCON =7 ' disable analog comparator
' ansel=0 NO ANSEL with the '629 !!!...
TRISIO = %11111110 ' set GPIO as output
' others as input
i VAR BYTE
clear
low Servo
pause 100
' commented outloop:
main:
while 1
IF Right THEN
pulsout Servo, 147
ELSEIF Left THEN
PULSOUT Servo, 152
ELSE
PULSOUT Servo, 150 ' Center/stop ( ? ) if no button pushed ...
ENDIF
Pause 19
WEND
end
Alain
Last edited by Acetronics2; - 10th February 2013 at 15:12.
************************************************** ***********************
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