Comparing different types of variables


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Code:
    if vservo1pos=>vservo1+12 then
    If vservo1 ends up being greater than 65,524, then vservo1 + 12 = 65536, which in a WORD variable ends up equalling ZERO...

  2. #2
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    vServo1 is a byte and cant go above 255.

    I will try declaring cServoOffTime as a variable instead. I think something similar to this was the reason for my thread about the datatypes of constants

  3. #3
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    That doesnt seem to work either.

    I just tried removing the constant completely and putting the value into the middle of the code and that works :S. I dont like doing that but in this case i dont really have a choice. The only problem now is the other line. vServo1 gets set by data from the serial port so i cant write the value into the code

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