Port control code Yelp!!


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    andyf's Avatar
    andyf Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks dave for the answer, tried the code, compiled it without errors but the bit does not change in the pic as in the longer version.

    is it possible I need to put some brackets or quotes?
    PortA.0([PIN]="1")

  2. #2
    andyf's Avatar
    andyf Guest


    Did you find this post helpful? Yes | No

    Post

    Just had a thought while making a coffee,

    are the declarations correct to do it your way?

    ' Variable Defs
    ' ------------

    SerData var byte
    PIN var byte
    STATE var byte
    in_ct var BYTE[10] 'In coming control arrey


    if STATE = "H" then PortA.[PIN]=1
    if STATE = "L" then PortA.[PIN]=0

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Andyf, Sorry I haven't returned a reply before this but I just got back from a wedding of one of my sisters kids. The wedding was in Traverse city which is about 4 hours away. I left Friday at noon and just got back Sunday at about 5:00pm. You have it right. the expression needs a Boolean operator to work so if you use one of the predefined keywords ie HIGH or LOW or 1 or 0 or a variable that would be set to 1 or 0 that would work. No need for brackets after the equals sign unless you have some kind of equation that requires hierarchal order. If that doesn't work I would check the Tris register for being setup properly.

    Dave Purola,
    N8NTA

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  2. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  3. How to set TMRO & TMR3 as Counter?.
    By NatureTech in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 18th May 2007, 08:52
  4. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 17:23
  5. Replies: 2
    Last Post: - 31st July 2006, 16:06

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