RF12 module need to convert some C to Basic


Closed Thread
Results 1 to 40 of 44

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    I really wonder if the skimask's example will work because is the same shiftout command.

    I have also ordered a couple of the modules (the high power ones) but will be delay and cannot test them right now.

    Ioannis

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    I really wonder if the skimask's example will work because is the same shiftout command.
    Ioannis
    It is the same...
    I think the only difference is toggling the SEL line.

  3. #3
    Join Date
    Dec 2007
    Posts
    60


    Did you find this post helpful? Yes | No

    Default nSEL

    Skimask,

    Thankyou for doing that... From the little bit of C that I have learnt in the last 24 hours, that looks good.

    I did try nSEL last night with a couple of code attempts, but I did not try it consistantly.

    I did also try to use the SSP last night for a short period. No luck yet, but I didn't expect it to be easy, I haven't used the SSP yet.

    I am off to work now, but will try again later today.


    Thanks for the assistance.
    Last edited by davewanna; - 9th June 2008 at 23:09.

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    It could be a timing issue. No time to check now. If anyone could?

    Ioannis

  5. #5
    Join Date
    Dec 2007
    Posts
    60


    Did you find this post helpful? Yes | No

    Default word to bit[16]

    I am just getting started on this again tonight...

    I the example from Skimask above, the variable CMD is I assume an array of 16 bits? so I should declare..

    Code:
    CMD  VAR  bit[16]
    Am I correct?


    My next question is how do I get my word variable into series of 16 bits?

    Code:
    dout = $D0F7
    
    for n = 16 to 0 step -1
      CMD[n] = %dout.15
      dout << 1
    next n


    Keep in mind I am almost certain that the above example will not work... It's just to show that I am trying, not just asking everyone else to make my project for me...

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    For this CMD[n] = %dout.15 try as:

    CMD.0[n] = %dout.15

    Ioannis

  7. #7
    Join Date
    Dec 2007
    Posts
    60


    Did you find this post helpful? Yes | No

    Default almost!

    My current attempt is....

    Code:
    cmd             var byte[15]
    dout = $C0F7
    
    ...
    
    lcdout $fe,$C0," "
    for n = 16 to 1 step -1
      CMD.0[n] = dout.15
      dout = dout << 1
      lcdout $fe,14,bin dout.15
    next n
    This results in ... 1000000111101110 ... and I want ... 1100000011110111 ...

    i.e. It has chopped the 1 off the start, and added a 0 on the end...

Similar Threads

  1. Version Control
    By btaylor in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 16th October 2011, 17:12
  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. Replies: 1
    Last Post: - 27th July 2008, 06:14
  4. using AND as an IF statement
    By dw_pic in forum mel PIC BASIC
    Replies: 27
    Last Post: - 8th June 2006, 18:05
  5. convert Basic Stamp2 (BS2) => Pic
    By bs2rdu in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th September 2005, 19: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