magbot code

I purchased the magbook "how to build a robot" sometime ago and now that winter is here am trying to code it. I am a beginner at this and cannot find the files that the book says are included with the IDE. I have managed to find a ping sketch and a whiskers sketch. I can make both of them operate on an individual basis. If I try to write a sketch which combines both only one will work? Is there anyone out there that can either tell me where to get all of the magbot code or help me to understand how to have multiple codes running at the same time?

Post the code here of the two sketches that you are trying to combine, and someone may help.
In the IDE, the examples are usually under File-> Examples. Sometimes, you have to install a specific library before the examples relevant to that library are visible to you.

The 2 files I am trying to combine are attached below. I think that once I understand how sketches are run together I should be able to work out how to do the rest for myself. Thanks for any help given.

sketch_whiskers1.ino (2.14 KB)

myPing2.ino (2.55 KB)

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom.. :slight_smile:

See here for combining 2 sketches: https://arduino-info.wikispaces.com/CombiningArduinoSketches

You should not have too much trouble, though one sketch uses delay() and the other pulseIn() which may possibly interfere with each other.