syntax error


Closed Thread
Results 1 to 19 of 19

Thread: syntax error

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi Malc,

    Use ...

    Setpoints(ADchan)
    <br>
    DT

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Hi Malc,

    Use ...

    Setpoints(ADchan)
    <br>
    Hmmm . . . so (ADchan) is a MATH operation ? I thought it was an array, if it is, then (brackets) are OK ?
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Hi Malc,

    Use ...

    Setpoints(ADchan)
    <br>

    How the hell did I miss that !

    Now just got to work out how to get the value with in the range !

    Thanks once again Darrel

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    How the hell did I miss that !

    Now just got to work out how to get the value with in the range !

    Thanks once again Darrel
    Hi Malc, I would say pretty darn easy, given the size of this program, I just un zipped it, nice work ! To all involved.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks, but really the credit for the coding goes to Darrel.

    I'm still a rookie in PBP, and it's taking me hours to try and work this out and I'm still having trouble getting the value from the pot to change the set temperature

  6. #6
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Still need help (Darrel ??)

    Code:
        FOR ADchan = 0 to 3
            GOSUB GetADC
            pots(ADchan) = ADvalue
            SetPoints(ADchan) = (Advalue / 100) 
            if SetPoints(ADchan) <200 then SetPoints(ADchan) = 200
            if SetPoints(ADchan) >500 then SetPoints(ADchan) = 500        
        NEXT ADchan
    and

    Code:
    LCDOUT $FE,$C0, DEC pots(0)>>1,"   "
    Gives a value on the LCD of between 1 and 8184 as the pot is turned from one extreme to the other

    however
    Code:
    LCDOUT $FE,$C0, DEC SetPoints(0)>>1,"   "
    Gives a static number, of 100 regardless of what position the pot is set to

    I would also like to know what to change to get the PC display to show the value of the setpoints - it still remains the same value (26 degrees) set by EE_setpoint value in the initial stages even though I've changed the setmode to manual

  7. #7
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default sorted !

    Managed to get this part to work.

    Code:
    FOR ADchan = 0 to 3
            GOSUB GetADC
            pots(ADchan) = ADvalue/10
            SetPoints(ADchan) = pots(ADchan) 
            if SetPoints(ADchan) <200 then SetPoints(ADchan) = 200
            if SetPoints(ADchan) >500 then SetPoints(ADchan) = 500 
            LCDOUT $FE,$C0, dec pots(0)>>1,"   "
    Now get a value between 0 and 818 when the pot is moved

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Exclamation

    Uno Momento por favor ...

    Are you using 14-bit?
    <br>
    DT

  9. #9
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Maybe I jumped to soon...

    strange thing is that whist the lcd is showing a value of 71, which I would assume would give a set point of 7.1 degree, the value on the PC is showing as 14.3

Similar Threads

  1. Compile error & syntax error on the word "loop:" as a label?
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th March 2010, 04:14
  2. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  3. Optimizing DIV
    By skimask in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 22nd September 2008, 04:58
  4. 16F88 Compile error
    By Toley00 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 2nd November 2005, 00:22
  5. Syntax error PIC16F684
    By milestag in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 21st September 2005, 18:54

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