Arduino uno + SAM3

Korean company maker of Robot kits and servos designed for of articulated robots. Re-incarnation of Megarobotics.
1 postPage 1 of 1
1 postPage 1 of 1

Arduino uno + SAM3

Post by nicolas gomez » Thu Jan 10, 2013 8:54 pm

Post by nicolas gomez
Thu Jan 10, 2013 8:54 pm

Hi
here a sam3 servo with arduino UNO

phpBB [media]



At 1-second intervals SAM3 back and forth between the position values ​​of 20 and 120.
Realistically UNO board power simply turning the servo one I use works fine.
Lines connect the UNO R3 connection has been so from the board.
VCC of 5V ~ SAM3
TX (DIGITAL 1 time) ~ SAM3 of RX
RX (DIGITAL 2 times) SAM3 of TX
GND GND ~ SAM3



/*
Blink & SAM Control
Turns on an LED and changes a SAM position on for one second, then off for one second, repeatedly.

This example code is in the public domain.
*/

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// for SAM control
int id; // SAM id
int torq; // torque level(0:max, 4:min)
int checksum; // protocol checksum
int tmp1, tmp2; // temporary byte
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
// start serial port at 115200 bps:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
id = 0;
torq = 2;
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
tmp1 = (torq << 5) | id;
tmp2 = 20; // position1
checksum = (tmp1 ^ tmp2) & 0x7f;
Serial.write(0xff);
Serial.write(tmp1);
Serial.write(tmp2);
Serial.write(checksum);
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
tmp1 = (torq << 5) | id;
tmp2 = 120; // position2
checksum = (tmp1 ^ tmp2) & 0x7f;
Serial.write(0xff);
Serial.write(tmp1);
Serial.write(tmp2);
Serial.write(checksum);
delay(1000); // wait for a second
}
--------------------------------------------------------------

SOURCE FROM
http://blog.daum.net/r0b0t/12725810
Hi
here a sam3 servo with arduino UNO

phpBB [media]



At 1-second intervals SAM3 back and forth between the position values ​​of 20 and 120.
Realistically UNO board power simply turning the servo one I use works fine.
Lines connect the UNO R3 connection has been so from the board.
VCC of 5V ~ SAM3
TX (DIGITAL 1 time) ~ SAM3 of RX
RX (DIGITAL 2 times) SAM3 of TX
GND GND ~ SAM3



/*
Blink & SAM Control
Turns on an LED and changes a SAM position on for one second, then off for one second, repeatedly.

This example code is in the public domain.
*/

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// for SAM control
int id; // SAM id
int torq; // torque level(0:max, 4:min)
int checksum; // protocol checksum
int tmp1, tmp2; // temporary byte
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
// start serial port at 115200 bps:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
id = 0;
torq = 2;
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
tmp1 = (torq << 5) | id;
tmp2 = 20; // position1
checksum = (tmp1 ^ tmp2) & 0x7f;
Serial.write(0xff);
Serial.write(tmp1);
Serial.write(tmp2);
Serial.write(checksum);
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
tmp1 = (torq << 5) | id;
tmp2 = 120; // position2
checksum = (tmp1 ^ tmp2) & 0x7f;
Serial.write(0xff);
Serial.write(tmp1);
Serial.write(tmp2);
Serial.write(checksum);
delay(1000); // wait for a second
}
--------------------------------------------------------------

SOURCE FROM
http://blog.daum.net/r0b0t/12725810
nicolas gomez offline
Savvy Roboteer
Savvy Roboteer
Posts: 95
Joined: Sat Aug 08, 2009 2:40 pm

1 postPage 1 of 1
1 postPage 1 of 1
cron