PDA

View Full Version : How do I declare variables?



emmett brown
- 28th June 2006, 03:30
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

mister_e
- 28th June 2006, 03:36
sorry, Melabs PicBasic compiler here.

Looks to me you use MikroBasic or another that i don't know

emmett brown
- 28th June 2006, 03:39
CHBasic but I'd switch in a heartbeat if i can figure out how to build this project. (very new at this and found the majority of this code on this forum. Thanks, Emmett

mister_e
- 28th June 2006, 03:47
I know Bruce here sell this product, but i found the following info on his website

CH Basic Compiler Tech-Support & Inquiries

General information: [email protected]
Sales department: [email protected]
Technical support: [email protected]