Hi, Malc ...
Think you change your Duty VERY frequently ( it's only a train ...not a jetfighter !!! ) ... so you could insert some PAUSE 100 - 300.
Secondly, you also could change DUTY ... only if the POT result changes.( a little Hysteresis w/ ADC could be useful ??? )
Third, you could insert a smooth duty transition ...
like that :
....
Dutyvar3 = 0
Main:
ADCIN 0, D
IF D <> DutyVar3 THEN
IF Dutyvar3 > D then Dtemp = Dtemp - 1 '( 1, 5, 10 ... as INERTIA needed ! )
IF Dutyvar3 < D then Dtemp = Dtemp + 1
DutyVar3 = Dtemp
ENDIF
PAUSE 200 '( to be trimmed ... 200 for 1 Channel, 100 for 2
Channels ...)
GOTO Main
... or something like that !!!
Alain
Last edited by Acetronics2; - 12th February 2007 at 15:28.
Reason: skipped PAUSE ...
************************************************** ***********************
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