Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Sending data between two Teensy 3.2s

  1. #1
    Junior Member
    Join Date
    Feb 2016
    Posts
    15

    Sending data between two Teensy 3.2s

    Hi,

    I need to be able to send some simple data from one teensy 3.2 to another. This will be used to trigger actions, so it's not a stream of data, or very complex data. It could just be simple numbers, but strings would be handy. They would just be sent as a result of other actions, so i don't think speed is particularly important. Latency between sending and recieving - yes, but not a high speed transfer of multiple pieces of data.

    I started looking at SPI, but I see that doing master/slave configurations is quite complicated on teensys... I read through this https://forum.pjrc.com/threads/50008...SPI_MSTransfer but I think it's overkill for what I need.

    Should I just be using a simple serial transfer, or wire?

    Or I2C?

    It seems there are probably many many ways to do what I want, but I'm confused as to which is the most fit for my purpose.

    Thanks for any advice!

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,768
    Normally Serial1 (or the other serial ports) is the simplest way. The nice thing about serial is you only need 1 signal wire for each data direction, plus GND.

    If your data is fairly simple, just use Serial1.write() on the sending side and Serial1.available() and Serial1.read() on the receiving side. For more complicated data, the EasyTransfer library is a popular choice. MIDI is another good way, if your events are simple enough fit into the structure of MIDI messages.

  3. #3
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,133
    Serial or i2c is feasable. But you will need to handle the serial data to parse the data you need, in i2c/spi you can send/receive data as blocks, like an indiced array ordered, 3rd option is CAN, but you would need transceivers to use it

  4. #4
    Senior Member
    Join Date
    Feb 2016
    Location
    Australia
    Posts
    231
    I think breadboard + 2x teensys + 3 wires + easytransfer examples straight from arduino ide menu will get you started.

  5. #5
    Junior Member
    Join Date
    Feb 2016
    Posts
    15
    Amazing, thanks everyone

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •