Why can't I make this assignment?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2011
    Posts
    35

    Default Why can't I make this assignment?

    Guess I've been away from PBP too long. Don't understand why I can't make this assignment:

    '======================
    DIPSWITCHES:
    '======================
    I2CREAD SDA1,SCL1,DIPSWITCH,[X] 'READ DIPSWITCH
    X=X^%11111111 'INVERT
    DEBUG "BIN X.BIT7=",BIN X.BIT7,13,10
    RELAYBOARD = BIN X.BIT7

    (I've tried declaring RELAYBOARD as a BIT and a BTYE)

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


    Did you find this post helpful? Yes | No

    Default Re: Why can't I make this assignment?

    BIN is an output modifier for commands like SEROUT2, ARRAYWRITE, DEBUG etc.
    It sends out an ASCII string representing a binary value such as 10111011, or in your case a single bit 1 or 0.
    It can not be assigned to a variable.

    If you just want a bit value equal to X.7, then remove the BIN modifier.
    DT

  3. #3
    Join Date
    Jul 2011
    Posts
    35


    Did you find this post helpful? Yes | No

    Default Re: Why can't I make this assignment?

    Thanks, Darrel

Similar Threads

  1. Can someone help me make a code for this:
    By joseph in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 18th May 2009, 22:03
  2. Binary assignment syntax - confused?
    By kevj in forum General
    Replies: 1
    Last Post: - 11th November 2007, 02:19
  3. Help on me assignment!!!
    By jaycart1986 in forum General
    Replies: 17
    Last Post: - 4th November 2006, 18:47
  4. I2C Pins Assignment
    By Peter1960 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 4th June 2006, 01:54
  5. pin assignment
    By cheznez in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd February 2005, 16:55

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