TOTAL NEWBIE - Line Following (3 Sensors)

First of all thank you to anyone that helps!

We (my son and I) are TOTALLY new to robotics and we are trying to make a robot follow a line. I have used google and found quite a bit of information. Of course I am posting because we have encountered a little issue.

We have purchased RedBot Kit (https://www.sparkfun.com/products/12697). We have downloaded the arduino software and tested the robot with the BLINK code and it worked.

We added the Redbot_ Arduino_Library and RedBot-Master.zip - Link from GithUb (both of these are referenced on this page under Documents - https://www.sparkfun.com/products/12697) and the RedBotKit Libraries.

We then opened Arduino software and Select Examples, RedBot, Demo it opens up the following CODE (See below). When I verify/Compile the code i get the following error - error: ‘followNoCal’ was not declared in this scope. Could some one please let me know what i am doing wrong?

Thanks…

/***********************************************************************

RedBot Demo1

Created 30 Jul 2013 by Mike Hord @ SparkFun Electronics.

This code is beerware- feel free to make use of it, with or without

attribution, in your own projects. If you find it helpful, buy me a beer

the next time you see me at the local- or better yet, shop SparkFun!

This is a simple line following demonstration using the RedBot.

It uses three of the line detection sensors to follow the line, and the

accelerometer to start the line following behavior.

***********************************************************************/

// Include the libraries. We make a provision for using the Xbee header

// via software serial to report values, but that’s not really used in

// the code anywhere.

#include <RedBot.h>

#include <SoftwareSerial.h>

// Instantiate the motor control class. This only needs to be done once

// and indeed SHOULD only be done once!

RedBotMotor motor;

// Instantiate the sensors. Sensors can only be created for analog input

// pins; the Xbee software serial uses pins A0 and A1 and the

// accelerometer uses pins A4 and A5.

RedBotSensor lSen = RedBotSensor(A2);

RedBotSensor cSen = RedBotSensor(A3);

RedBotSensor rSen = RedBotSensor(A6);

// Instantiate the accelerometer. It can only be connected to pins A4

// and A5, since those are the I2C pins for this board.

RedBotAccel xl;

// Create a software serial connection. See the Arduino documentation

// for more information about this. The pins used here are the hard

// wired pins the Xbee header connects to.

SoftwareSerial xbee(15, 14);

void setup()

{

Serial.begin(57600);

xbee.begin(57600);

// Enable bump detection. Once a bump occurs, xl.checkBump() can be

// used to detect it. We’ll use that to start moving.

xl.enableBump();

}

// Variable used to wait on a bump before starting operation.

boolean following = false;

void loop()

{

// checkBump() checks a register in the accelerometer to see if a

// bump has happened since the last time checkBump() was run. If

// one HAS occurred (i.e., the user tapped the accelerometer),

// start following the line!

if (xl.checkBump() && following == false) following = true;

if (following)

{

followNoCal();

}

}

It means the compiler can’t find the function named followNoCal(). Seems that indicates that you don’t have RedBot library installed fully. Read these …

https://learn.sparkfun.com/tutorials/ge … ot/discuss

https://learn.sparkfun.com/tutorials/ge … no-library

Thank you…

I worked with sparkfun Tech Support (Allison and Ho Yun “Bobby” Chan). Here was the issue: First of all i had the path wrong to the Libraries and secondly I removed ALL libraries (Redbot_ Arduino_Library, RedBot-Master and RedBotKit) and only installed ONE “REDBOT”. Once i did that I was able to compile the code and UPLOAD it to the Redbot.

We are ALMOST THERE…Now when the code is uploaded to the RedBot… 1) how do you get the robot to start? We picked it up and put it down and then it started… but we also just let it set there and it never started… 2) If we take the usb cable out of the robot it stops… Is there something we need to keep the code active on the redbot?

Is the battery pack plugged in ?

Is the power switch on ?

Is the power LED on ?

https://dlnmh9ip6v2uc.cloudfront.net/as … 958fd5.jpg

Also check the positions of the motor disable and XBee switches.

Is the battery pack plugged in ? YES

Is the power switch on ? YES

Is the power LED on ? YES

I was able to run Blink Demo (Turns on an LED on for one second, then off for one second, repeatedly.)

Also check the positions of the motor disable and XBee switches Motor Switch is on… Where SHOULD the Xbee Mode switch be?

Where SHOULD the Xbee Mode switch be?

If you can program the mainboard and don't have an XBee, I don't think it matters.

What program did you load ? This one runs the motors for 2 secs (at power on/reset) and then stops.

https://github.com/sparkfun/RedBot/blob … orward.ino

The program i ran is attached to this post.

Did you “bump it” per the comments ?

// Enable bump detection. Once a bump occurs, xl.checkBump() can be
// used to detect it. We’ll use that to start moving.

// checkBump() checks a register in the accelerometer to see if a
// bump has happened since the last time checkBump() was run. If
// one HAS occurred (i.e., the user tapped the accelerometer),
// start following the line!