Charlie-plexing


Results 1 to 40 of 61

Thread: Charlie-plexing

Threaded View

  1. #13
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: Charlie-plexing

    I will try your suggestions though I think typing OR seems the easiest.
    Though it looks cool to use those symbols I think it's easier just to type OR and know what it means
    .


    NOT sure about that , this is what the book says


    3.4.2 Logical vs. Bitwise

    Logical operators are very different than bitwise operators! There are

    circumstances under which PBP will allow the use of logical operators in
    expressions. This means that no error message will be generated when you
    mistakenly use a logical operator in a bitwise calculation. Consider the following:
    result = PORTB AND %00001111
    ' Returns logical result (1 or 0)
    The above example will compile and give a result. The value of the result can only
    be one or zero (true or false). If the intent is to use a bitwise operation to obtain a
    binary result, you MUST USE BITWISE OPERATORS:
    Code:
       i_term=0
       d_err=4
       i_err= 3 
       i_term= i_err |  d_err
       serout2 PORTA.0,84,[ "3 | 4 ",9,#i_term, 13,10]
       i_term= i_err OR d_err
       serout2 PORTA.0,84,[ "3 OR 4 ",9,#i_term, 13,10]
    PRINTOUT:
    3 | 4 7
    3 OR 4 65535
    Last edited by richard; - 29th June 2016 at 05:36.
    Warning I'm not a teacher

Members who have read this thread : 2

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