Pages: [1]   Go Down
Author Topic: HiTechnic Motor Controller  (Read 972 times)
0 Members and 1 Guest are viewing this topic.
Minnesota!
Offline Offline
Sr. Member
****
Karma: 0
Posts: 386
My nickname on the forum used to be Soapy29.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: March 12, 2013, 11:43:00 pm by Soapy29 » Logged

Find AKSoapy29 on:
Youtube
Website

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 442
Posts: 23834
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What's a Tetrix Motor Controller?  Got a link?
Logged

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.

Minnesota!
Offline Offline
Sr. Member
****
Karma: 0
Posts: 386
My nickname on the forum used to be Soapy29.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Whoops, meant to say HiTechnic DC Motor Controller. http://www.legoeducation.us/eng/product/hitechnic_dc_motor_controller/1648

Edit: I think I found a PDF that would be useful: http://www.legoeducation.us/etc/supportFiles/TETRIX/739413/HiTechnicMotorControllerBriefv1.3.pdf
« Last Edit: March 14, 2013, 07:44:25 pm by Soapy29 » Logged

Find AKSoapy29 on:
Youtube
Website

Minnesota!
Offline Offline
Sr. Member
****
Karma: 0
Posts: 386
My nickname on the forum used to be Soapy29.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
« Last Edit: March 14, 2013, 07:43:18 pm by Soapy29 » Logged

Find AKSoapy29 on:
Youtube
Website

Minnesota!
Offline Offline
Sr. Member
****
Karma: 0
Posts: 386
My nickname on the forum used to be Soapy29.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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?
Logged

Find AKSoapy29 on:
Youtube
Website

Pages: [1]   Go Up
Jump to: