collecting pin states to send across xbee.

RMCanawayRMCanaway Posts: 6
edited 2019-03-25 - 03:12:04 in Propeller 1
Is it possible to check the pin states (Like a button on each one) from pins 0 to 7, Store it in a temporary value to send across an xbee?

Comments

  • something like:
    VAR      byte    symbol
    
        symbol := ina[7..0]
    
    

    pointer to a book


    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
  • something like:
    VAR      byte    symbol
    
        symbol := ina[7..0]
    
    

    pointer to a book


    How can I read the values on the xbee receive side?
  • Download and study the excellent tutorial by Martin Hebel "Getting started with Xbee RF Modules".
  • Here's the code i've been working with. Let me know what i can improve on to make it function properly.
  • Does it work? If not, what are the symptoms?
    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
  • The board I've been designing is a new controller for robotics at my school. it has 8 buttons (0..7 pins) and joysticks (8..11pins) the joysticks work perfectly without any delay. However I have not found a way to send the button data proficiently. I need a way to send the buttons values in packets like earlier mentioned, and to receive them and read each individual button on the receiver.
  • Looks like in TANKDRIVECODE you read the buttons only once at the top and send the same value over and over.
    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
  • I had just changed that earlier, i had it in the repeat. It still was refusing to work. I'm just getting into .spin, however i have prior experience with LUA, C, and Java
  • I did a similar project where it emulated a joy stick or RC transmitter.

    joystick rc transmitter using c
    I prefer C over SPIN.

    Mike
  • tomcrawfordtomcrawford Posts: 1,050
    edited 2019-03-26 - 21:39:39
    Well, if the pst.bin is displaying what you expect, then the buttons must be wired correctly. Just make sure both end of the XBee link agree on what a packet looks like...

    Edit: My inclination would be to gather all the variables on the tx side and then send them at once. Isolate the gathering from the transmission, so to speak. And I would probably send a checksum, as well. Similarly on the rx side. EndEdit
    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
  • RMCanawayRMCanaway Posts: 6
    edited 2019-04-25 - 13:27:41
    On my Robot Controller, I have the button data being sent in 8 bit data packets. I just need to know what button is being pressed on the receive side .



    Thanks,
    Ryan Canaway
Sign In or Register to comment.