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

Thread: Teensy 4.0 as a slave

  1. #1
    Junior Member
    Join Date
    Oct 2020
    Posts
    11

    Teensy 4.0 as a slave

    Is anyone knows how to setup the teensy as a slave with a raspi?

  2. #2
    Senior Member
    Join Date
    Jul 2020
    Posts
    174
    For what purpose, and using what mode of communication?

  3. #3
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,463
    I used the UART console once on a raspi3, so Teensy could have ADB/SSH capabilities

  4. #4
    Junior Member
    Join Date
    Oct 2020
    Posts
    11
    I want to use opencv a n the raspi to guide my robot (color detection) and relay some info to the teensy that control the motors

  5. #5
    Color detection?
    And you also have a RasPi?

    Why do you absolutely insist on making your project more complicated than it needs to be?
    The Teensy 4.x is comparable to an RPi Zero in processing power, but without the wasted cycles of a large OS.
    And here are Real-time OSes available for Arduino and Teensy.

  6. #6
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,872
    It may also depend on your whole setup.

    For example with earlier ROS, I know some Arduino devices were setup to handle a ROS topic or two using ROS Serial support...

    With ROS2, I know that some Arduino devices could be setup to work over Ethernet or the like as independent ROS nodes.

    At one point I was playing around with some of the stuff with Robotis boards and their XEL setup and the like.
    For example there is their library: https://github.com/ROBOTIS-GIT/ros2arduino

    Where for example on a Turtlebot3 the OpenCR board can work as a nodes. I have not looked in awhile to know if it requires Ethernet or if there are other forms of IO that is now supported.

  7. #7
    Junior Member
    Join Date
    Oct 2020
    Posts
    11
    The #include <i2c_register_slave.h> works with my RPi3 but not with my RPi 4. Any clue?

  8. #8
    Senior Member
    Join Date
    Jul 2020
    Posts
    174
    Perhaps you want to use the Teensy to control the motors because you have found a way to do it, and you don't know how to achieve the same effect on the Pi, and the project taxes your current skill level enough that you prefer to do it this way. That is perfectly valid. Or, perhaps you simply want to split the motor control to the Teensy because you want to learn from figuring out how to get it to communicate with the Pi. That is also perfectly valid.

    However: If the goal is only to get something up and running, the Pi can do this itself. It has enough GPIO, and the CPU need only spend a tiny fraction of its resources on motor control compared to computer vision. If you want to do this in the easiest way possible, get a motor shield for the Pi, and have it do both vision and motor control.

    As for the #include problem, you will probably get better advice on a Pi-specific forum. When asking for such help, you really need to include both the source code and the error you got.

Tags for this Thread

Posting Permissions

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