Go Down

Topic: HiTechnic Motor Controller (Read 1 time) previous topic - next topic

AKSoapy29

Mar 13, 2013, 05:24 am Last Edit: Mar 13, 2013, 05:43 am by Soapy29 Reason: 1
Hello. I was wondering if it would be possible to have one or many HiTechnic Motor Controllers interfaced with Arduino. They are I2C, but I don't know anything about that. I am using UNO R3.
Andrew K.

CrossRoads

What's a Tetrix Motor Controller?  Got a link?
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

AKSoapy29

#2
Mar 13, 2013, 05:41 am Last Edit: Mar 15, 2013, 01:44 am by Soapy29 Reason: 1
Andrew K.

AKSoapy29

#3
Mar 15, 2013, 12:07 am Last Edit: Mar 15, 2013, 01:43 am by Soapy29 Reason: 1
So for the code, I know I need to use the Wire library for I2C communications. Basically, I would be sending motor 1, or address 02, a value for the motor speed, right? I know in Labview for FTC, the motor values go from 0-255, so I don't know if they are the same here or not.

And also, how would I wire it to my Arduino? I was thinking of just stripping the wires, or using this breakout: https://store.wayneandlayne.com/products/bricktronics-breakout-board.html

Basically, I don't know exactly how to approach this project, but I have ideas how.
'
Edit: I found a website with how the wires are layed out in the connector. http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=136
I have an Uno R1 & R3, so SDA goes to A4, and SCL goes to A5, correct? And of course, 5V to 5V, and GND to GND.

Also found another picture with what the 6th lead is, and color codes:
Andrew K.

AKSoapy29

Reading the spec sheet for the controller, the range for the speed goes from -100 to 100. 45H and 47H are power for each motor. So here is how I think I would write the code:

Code: [Select]

#include <Wire.h>

byte speed = 100;

void setup()
{
  Wire.begin(); // join i2c bus
}

void loop()
{
  Wire.beginTransmission(0x02); // transmit to device #44 (0x2c)
                              // device address is specified in datasheet
  Wire.write(speed);             // sends value byte 
  Wire.endTransmission();     // stop transmitting
  delay(500);
}


That should send 100 to address 0x02 every half second, but how does it know to set motor one to 100? Do I have to send a string of data?
Andrew K.

Go Up