Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base: HardFIFO
...
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 9 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Commits on Oct 20, 2012
@cmonr Updated README.md
Signed-off-by: Cruz Monrreal II <Cruz.Monrreal@gmail.com>
6dac238
@cmonr Updated README.md
Signed-off-by: Cruz Monrreal II <Cruz.Monrreal@gmail.com>
3d28e26
@cmonr Merge branch 'master' of https://github.com/cmonr/Arduino-Sphero-Library


Conflicts:
	README.md
f528f25
@cmonr Damn markup...
Signed-off-by: Cruz Monrreal II <Cruz.Monrreal@gmail.com>
741cfa7
Commits on Nov 11, 2012
@cmonr Pushing IMU refresh rate to 25Hz
Using Bluetooth library to autoconnect to Sphero

Signed-off-by: Cruz Monrreal II <Cruz.Monrreal@gmail.com>
54fb6cd
@cmonr Removed Autoconnect setting. Address is saved in BT adapter.
Signed-off-by: Cruz Monrreal II <Cruz.Monrreal@gmail.com>
2cad602
@cmonr Autoconnect to Bluetooth
Set IMU refresh rate to 10Hz

Signed-off-by: Cruz Monrreal II <Cruz.Monrreal@gmail.com>
1708860
Commits on Nov 12, 2012
@cmonr Added blinking LED before control begins.
Doubled driving speed

Signed-off-by: Cruz Monrreal II <Cruz.Monrreal@gmail.com>
63399b1
Commits on Nov 25, 2013
@cmonr Update README.md 0565b30
View
38 README.md
@@ -1,21 +1,27 @@
Arduino-Sphero-Library
======================
+
+Notice: At this time, I do not plan on updating the Arduino Sphero or Bluetooth libraries.
+
+
This is a -basic- Sphero Library for the Arduino.
-Things needed:
- * Bluetooth Modem (http://www.sparkfun.com/products/9358)
- * Arduino (Only tested w/ Duemilanove)
- * Jumper Wires
-
-Instructions:
- 1) Connect tx,rx pins on Bluetooth Module to pins 3,2 on Arduino
- 2) Connect CTS and RTS to eachother
- 3) Connect 5v and GND to Arduino 5V and GND
- 4) Upload the AutoConfigBluetoothForSphero example, and run with the Serial Monitor
- 5) Power cycle Arduino & Bluetooth Module (unplug & replug USB cable)
- NOTE: Upon power up, the Sphero should autoconnect
- 6) Upload and run the SpinMeRightRound example
-
-API:
- Coming soon. For now, reference Sphero.h for implemented functions (Yes, I need more comments, I know...)
+Things needed:
+
+* Bluetooth Modem (http://www.sparkfun.com/products/9358)
+* Arduino Mega 2560
+* Jumper Wires
+
+
+Instructions:
+
+1. Connect tx,rx pins on Bluetooth Module to TX1, RX1 on Arduino Mega
+2. Connect CTS and RTS to eachother
+3. Connect 5v and GND to Arduino 5V and GND
+4. Shake on Sphero
+5. Upload the AutoConfigBluetoothForSphero example, and run with the Serial Monitor
+6. Power cycle Arduino & Bluetooth Module (unplug & replug USB cable)
+: NOTE: Upon power up, the Sphero should autoconnect
+7. Upload and run any of the examples
View
5 examples/AutoConfigBluetoothForSphero/AutoConfigBluetoothForSphero.ino
@@ -78,12 +78,9 @@ void loop(){
// Save address
sendCmd("SR," + sphero_id.substring(0, 12));
- // Configure Bluetooth to autoreconnect
- sendCmd("SM,3");
-
// We're done here!
sendCmd("---");
- Serial.println("\nConfiguration complete!\nYou're Sphero will now autoconnect upon powerup!\n\nHave fun ^^;");
+ Serial.println("\nConfiguration complete!\nYou're Sphero's address has been saved in the Bluetooth Module\n\nHave fun ^^;");
// Idle...
while(true);
View
13 examples/ReadIMU/ReadIMU.ino
@@ -8,20 +8,27 @@
************************************************/
#include <Sphero.h>
+#include <Bluetooth.h>
Sphero sphero;
+Bluetooth bluetooth;
void setup() {
Serial.begin(115200);
+ // Connect to Sphero
+ bluetooth.beginCMD();
+ bluetooth.connect();
+ bluetooth.endCMD();
+
// Indicator LED
sphero.setBackLED(0xFF);
// Lock motors
sphero.setStabilization(0);
- // Get Pitch @ 10Hz
- sphero.setStreamingData(10, 1, SPHERO_IMU_PITCH | SPHERO_IMU_ROLL | SPHERO_IMU_YAW);
+ // Get Pitch @ 25Hz
+ sphero.setStreamingData(25, 1, SPHERO_IMU_PITCH | SPHERO_IMU_ROLL | SPHERO_IMU_YAW);
}
void loop() {
@@ -33,4 +40,4 @@ void loop() {
Serial.print((signed short)sphero.getData(2) << 8 | sphero.getData(3));
Serial.print(", ");
Serial.println((signed short)sphero.getData(4) << 8 | sphero.getData(5));
-}
+}
View
35 examples/SpheroTankControl/SpheroTankControl.ino
@@ -1,15 +1,17 @@
/************************************************
Written by Cruz Monrreal II
Created on 08-19-2012
- Modified on 10-20-2012
+ Modified on 11-11-2012
Updates can be found here:
https://github.com/cmonr/Arduino-Sphero-Library
************************************************/
+#include <Bluetooth.h>
#include <Sphero.h>
#include <SabertoothSimplified.h>
+Bluetooth bluetooth;
Sphero sphero;
SabertoothSimplified ST;
@@ -18,16 +20,31 @@ void setup() {
ST.drive(0);
ST.turn(0);
- // Indicator LED
- sphero.setBackLED(0xFF);
+ delay(3000);
+
+ // Connect to Sphero
+ bluetooth.beginCMD();
+ bluetooth.connect();
+ bluetooth.endCMD();
// Lock motors
sphero.setStabilization(0);
+ // Give user a chance to align w/ dot
+ for(int i=0; i<10; i++){
+ sphero.setBackLED(0xFF);
+ delay(500);
+ sphero.setBackLED(0x00);
+ delay(500);
+ }
+
+ // Indicator LED
+ sphero.setBackLED(0xFF);
+
// Init Heading to 0
sphero.setHeading(0x00);
- // Get Pitch @ 5Hz
+ // Get Pitch @ 10Hz
sphero.setStreamingData(10, 1, SPHERO_IMU_PITCH | SPHERO_IMU_YAW);
}
@@ -39,16 +56,16 @@ void loop() {
yaw = sphero.getData(2) << 8 | sphero.getData(3);
if (yaw < -70 && yaw > -140){
- ST.turn(-50);
- }else if (yaw > 70 && yaw < 140){
ST.turn(50);
+ }else if (yaw > 70 && yaw < 140){
+ ST.turn(-50);
}else if (pitch < -50){
- ST.drive(-50);
+ ST.drive(-100);
//ST.turn(0);
}else if (pitch > 50){
- ST.drive(50);
+ ST.drive(100);
}else{
ST.drive(0);
ST.turn(0);
}
-}
+}

No commit comments for this range

Something went wrong with that request. Please try again.