When I compile this dude, the line that is to compare var6 with var7 "IF {var6} => {var7} THEN" comes up "variable has not been declared" what am I doing wrong? I'm trying to do a voltage controlled pulse generator if voltage goes up (1-5v) frequency goes up (200-1000 Hz)
PIC 16F877
FREQ 4
OSCILLATOR CRYSTAL
WORD var6-16bitunsignedintegers(0..65535,var7-16bitunsignedintegers(0..65535
WORD
SWORD var2-16bitsignedintegers(35,var3-16bitsignedintegers(55
*Begin :
*PVAL = 200 ' Start with .200 kHz
*For Duty = 64 to 250
*HPWM 1,Duty,PVAL
*PAUSE 1000
ADC_Config 1, 1, 1, 0, 1
ADC_On
ADC_Start
ADC_Store var7-16bitunsignedintegers(0..65535
*NEXT Duty
*Duty = 127 ' 50% Duty-cycle
*For PVAL = 650 to 850 step 1 ' Increments of 1. Change as needed
*HPWM 1,Duty,PVAL
*PAUSE 10
' VAR 6 IS TARGET VAR 7 IS DATA
Poke var6-16bitunsignedintegers(0..65535_H, var7-16bitunsignedintegers(0..65535_H
IF {var6} => {var7} THEN
*Next PVAL
*GOTO Begin
*END
Bookmarks