How do I declare variables?


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2006
    Posts
    35

    Default How do I declare variables?

    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

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    sorry, Melabs PicBasic compiler here.

    Looks to me you use MikroBasic or another that i don't know
    Last edited by mister_e; - 28th June 2006 at 03:38.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Jun 2006
    Posts
    35


    Did you find this post helpful? Yes | No

    Default

    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

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    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]
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Max Variables
    By shawn in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th January 2008, 04:05
  2. Changing declared variables names on the fly
    By jessey in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th December 2006, 06:34
  3. Variables not appearing in Watch Window MPLabv7.3
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th June 2006, 14:36
  4. edit names of variables
    By mischl in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th January 2005, 21:00
  5. Problems with variables
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th December 2004, 18:37

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts