PDA

View Full Version : Another Parallax Robot



Fire$torm
03-17-17, 11:11 AM
Hey folks,

With my Teensy project entering the programming phase, I was working out how I was going approach it when I received an email from DrPop. He had an extra Parallax kit laying around that is daughter Kat had lost interest in and was offering it to me. WOW! Like a totally answered prayer! DrPop is really one awesome dude!

So Thank You sir for the generous help. Much appreciated. \m/ :-bd

[B]My Parallax Robot
http://tinyurl.com/kb7dlta

This bot uses the Arduino Uno board. It's one of the easiest Arduino's to program. Uno will be a huge help with my Teensy project. Parallax has a really good tutorial, online (http://learn.parallax.com/tutorials/robot/shield-bot/robotics-board-education-shield-arduino) and in PDF format (https://www.parallax.com/downloads/robotics-board-education-shield-arduino), that seems to cover everything to get this bot moving. I have chosen to use the PDF to help keep things portable while I'm learning to program on my laptop. Also, I'm using OwnCloud to keep all the Arduino IDE files synced between my lappy and desktop systems.

On a side note, totally free products like NextCloud/OwnCloud will pretty much kill the dependency for online file sharing services like Google Drive, DropBox, etc. with all the restrictions and data mining that those services impose on it's users. So like if you are really into file sharing, you should seriously consider spinning out your own NextCloud server. (https://nextcloud.com/install/) They offer builds for Raspberry Pi, Linux, Macs, and Windows. I've even found a derivative of NextCloud for my BeagleBone Black! (http://beagleboard.org/black)

DrPop
03-19-17, 02:27 AM
SWEET! You got it mobile, F$, that is awesome. :D Double thumbs up for being able to run a mini server on the Beaglebone Black, that's some cool stuff. Best of luck with the builds, I'm in the process of learning how to code a little better, and scheming up ideas for my next bot too. :)

Fire$torm
03-24-17, 05:49 PM
I am actually getting the hang of this programming thing!

Here is a 40 sec. demo of my rudimentary KB hacking....

https://youtu.be/v3LNiDozyic

And just in case anyone is interested in the code.


/*
Robotics with the BOE Shield – ServoRunTimes_withTurnSignals
Performing tight Left and Right turns with LED signaling.
*/

#include <Servo.h> // Include Servo Library
Servo servoLeft; // Declare Left Servo Signal
Servo servoRight; // Declare Right Servo Signal


void setup() // Built-in initialization block
{
servoLeft.attach(13); // Attach Left Servo to pin 13
servoRight.attach(12); // Attach Right Servo to pin 12
pinMode(11, OUTPUT); // Set Digital Pin 11 -> Output
pinMode(10, OUTPUT); // Set Digital Pin 10 -> Output

Start:

Left_Turn:
for(int l = 1; l <= 3; l++)
{
digitalWrite(11, HIGH); // Pin 11 = 5 V, LED emits light
delay(500); // ..for 0.50 seconds
digitalWrite(11, LOW); // Pin 11 = 0 V, LED no light
delay(250); // ..for 0.25 seconds
}
delay(500); // ..for 0.75 seconds
servoLeft.writeMicroseconds(1300); // Pin 13 PWM Clockwise Signal
servoRight.writeMicroseconds(1300); // Pin 12 PWM Clockwise Signal
delay(3000); // ..for 3 seconds

Break1:
servoLeft.writeMicroseconds(1500); // Pin 13 PWM Stay Still Signal
servoRight.writeMicroseconds(1500); // Pin 12 PWM Stay Still Signal
digitalWrite(11, HIGH); // Pin 11 = 5 V, LED emits light
digitalWrite(10, HIGH); // Pin 10 = 5 V, LED emits light
delay(1000); // ..for 1.0 seconds
digitalWrite(11, LOW); // Pin 11 = 0 V, LED no light
digitalWrite(10, LOW); // Pin 10 = 0 V, LED no light
delay(1000); // ..for 1.0 seconds

Right_Turn:
for(int r = 1; r <= 3; r++)
{
digitalWrite(10, HIGH); // Pin 10 = 5 V, LED emits light
delay(500); // ..for 0.50 seconds
digitalWrite(10, LOW); // Pin 10 = 0 V, LED no light
delay(250); // ..for 0.25 seconds
}
delay(500);
servoLeft.writeMicroseconds(1700); // Pin 13 PWM CounterClockwise Signal
servoRight.writeMicroseconds(1700); // Pin 12 PWM CounterClockwise Signal
delay(3000); // ..for 3 seconds

Break2:
servoLeft.writeMicroseconds(1500); // Pin 13 PWM Stay Still Signal
servoRight.writeMicroseconds(1500); // Pin 12 PWM Stay Still Signal
digitalWrite(11, HIGH); // Pin 11 = 5 V, LED emits light
digitalWrite(10, HIGH); // Pin 10 = 5 V, LED emits light
delay(1000); // ..for 1.0 seconds
digitalWrite(11, LOW); // Pin 11 = 0 V, LED no light
digitalWrite(10, LOW); // Pin 10 = 0 V, LED no light
delay(1000); // ..for 1.0 seconds

goto Start; // sends program flow to Start

}
void loop() // Main loop auto-repeats
{ // Empty, nothing needs repeating

}


I know, I know, Using a goto was unnecessary as I could have just put most of the code into the "void loop()" function declaration section. I just like goto statements.