Using Teensy 3.2 or Teensy 3.6 with RoboClaw Arduino Library

General discussion of using Roboclaw motor controllers
Post Reply
George
Posts: 12
Joined: Fri Jul 01, 2016 6:05 pm
Using Teensy 3.2 or Teensy 3.6 with RoboClaw Arduino Library

Post by George »

Hi,

Previously I tested my RoboClaw 2X15 with Arduino Uno and your Arduino RoboClaw library and it all worked very well. I would prefer using the Teensy 3.2 or Teensy 3.6 to control my motor via the RoboClaw board and I wonder if you know if your Arduino library will work with those microcontrollers.
My experience is that most Arduino Libraries work with Teensy uC since they use same Arduino IDE but Teensy 3.2 or 3.6 have more serial ports and other peripherals.
Also Teensy 3.2 and 3.5 use 3.3Volt logic levels and I wonder if I have to do any level translation between RoboClaw (5V) and Teensy 3.3V.

Thanks
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Using Teensy 3.2 or Teensy 3.6 with RoboClaw Arduino Library

Post by Basicmicro Support »

The latest version of the Roboclaw arduino library should work with the Teensy Arm processors. You just have to pass a pointer to the serial port you are using to the Roboclaw constructor. I dont beleive Teensy Arm supports software serial so you can only pass hardware serial port object points.
Eoghan Killalea
Posts: 5
Joined: Thu Feb 07, 2019 10:44 am
Re: Using Teensy 3.2 or Teensy 3.6 with RoboClaw Arduino Library

Post by Eoghan Killalea »

Basicmicro Support wrote:The latest version of the Roboclaw arduino library should work with the Teensy Arm processors. You just have to pass a pointer to the serial port you are using to the Roboclaw constructor. I dont beleive Teensy Arm supports software serial so you can only pass hardware serial port object points.
Could you please explain this further? I am very much struggeling to get my TEENSY 3.5 working with my roboclaw.

Thanks,
Eoghan
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Using Teensy 3.2 or Teensy 3.6 with RoboClaw Arduino Library

Post by Basicmicro Support »

Teensy 3.2 has 3 hardware serial ports(Serial1,Serial2 and Serial3). Teensy 3.6 has 6(Serial1 thu Serial6). Those names Serial1 for example are the names of the objects. You pass them as the first argument in the Roboclaw constructor:

RoboClaw roboclaw(&Serial1,10000);

The second argument should be left as 10000(10ms timeout).

You need to do a Serial1.begin(baudrate) with the correct Roboclaw baudrate, in your Setup function as well.

This should just work assuming Teensy is compatible with regular arduino(UNO, Mega etc...).

Note: I dont have nor have I ever had a Teensy to test. This is just based on the information available online about the Teensy line.

Note 2: If you specify the serial format you must use 8N1 to talk with the Roboclaw. I believe the constructor defaults to that if you dont specify the serial format.

Post Reply