Go Back   BWHacks > Development > Programming

Programming General non-hacking related programming.

Reply
 
LinkBack Thread Tools

Old 08-04-2008, 06:51 PM   #1 (permalink)
Phoenixs

Heretic
 
Phoenixs's Avatar
 
Join Date: Jul 2008
Posts: 29
Phoenixs is on a distinguished road
Default Project: Building your own robot

Hello coders of BWhacks. As the topic says, i'm writing a guide to build your own, very simple, robot. See pics at bottom of this guide.

There are lot of online documentation available in this project. It makes this little easier.

Difficulty: Medium
Money required: ~120euros

Here is one good pic of ready robot, yours might look like this too:

http://www.mbnet.fi/nettijatkot/2005...bo/robotti.jpg

What is a robot then?

In my opinion, robot is machine, that doesn't require any controlling. It can decide it own moves. In example, robot could think to turn left or right.

Parts list and stuff:

So, lets begin. You can get most of stuff from normal shops but some parts you may need to order from internet. In order to build your robot, you need stuff that I've listed below.:

  1. OOPic Microcontroller ( OOPic Home Page )
  2. 2 x Servo's ( Futaba suits well )
  3. 2 x Infra red sensors
  4. 1 x 9V battery
  5. Plastic or Aluminum as body.
  6. Basic skills in welding.
  7. Basic skills in programming.

Optional but important:

  1. Time & patience
  2. Money, cos some components are not so cheap. I would say around 120 euros and you are ready to start.
  3. Coffee ( coca cola will be fine too )
  4. Good attitude

So, now we have all stuff we need to start our project. We are using microcontroller as a hearth of our robot, servos as "feets" and infrared sensors as eyes.

Programming

We are trying to get our robot move around, avoid obstacles, spin around, blink leds and play simple sounds. All this is done with programming. OOPic microcontroller has EEPROM memory, so we are writing source code, compile it and transfer it to microcontrollers memory. Sounds simple, eh?

We can use C++, Java or Visual Basic to write our program. I choosed C++. To start programming, we need to use OOPics own IDE.

You can download IDE here: http://tinsley.no-ip.org/files/ooPIC611Setup.exe

You should have this screen after installation:
http://img53.imageshack.us/img53/8141/oopicfb1.png

So now plug in serial cabel that came with OOPic ( or go buy one ) to your computers port and to microcontroller, now we can start to program and compile our first program. Also plug in 9V battery.

Our first program:

Since we don't have LCD-monitor yet, we can't make it show us legendary "hello world", we are making it to blink led.

Code:
oLED led = New oLED;
led.IOLine = 7;
led.TurnOn;
Do{
  led.Brightness.Inc;
  Delay = 50;
}
Very simple. After you have wrote this to editor, press F5 to Compile & transfer it to microcontrollers memory.

Code:
oLED RedLed = New oLED;
oLED YellowLed = New oLED;
oLED GreenLed = New oLED;

GreenLed.IOLine = 5;
GreenLed.TurnOn;

YellowLed.IOLine = 6;
YellowLed.TurnOn;

RedLed.IOLine = 7;
RedLed.TurnOn;
Do{
  RedLed.Brightness.Inc;
  YellowLed.Brightness.Inc;
  GreenLed.Brightness.Inc;
  Delay = 50;
}
Blink all three leds simultaneously.

Code:
oLED RedLed = New oLED;
oLED YellowLed = New oLED;
oLED GreenLed = New oLED;

oServo servo = New oServo;
servo.IOLine = 31;
servo.Adjust = 28:
servo.Operate = cvTrue;


GreenLed.IOLine = 5;
GreenLed.TurnOn;

YellowLed.IOLine = 6;
YellowLed.TurnOn;

RedLed.IOLine = 7;
RedLed.TurnOn;

Do{

  servo = 0;
  ooPIC.Delay = 1500;
  servo = 63;
  
  RedLed.Brightness.Inc;
  YellowLed.Brightness.Inc;
  GreenLed.Brightness.Inc;
  Delay = 50;
}
Blinking all three leds and controlling left servo.

If you've done all things right, you will now see one led blinking in your microcontroller. Congratulations.

Final words:

If you really are interested about making good robot, you can buy more components to your project. Like lcd monitors, more memory etc

Now you can start working with your program. You can do a lot with this, just use your imagination. ie. i'm building a robot that moves in my house, avoids things and such.

If you wonder why I mentioned about skills in welding; You may need that stuff when you are making stuff to your bot. in example, depending of servo model, you may need to modify & hack it.

If you need any help, or if you have questions; Use google or ask here.

I'm very sorry of lacking most pictures, but I found out that my camera's memory is broken, so goodbye pics :/

If you need more examples or anything just ask, I will write more

Pics:

http://www.lynxmotion.com/images/Pro...ll/oopic01.jpg MicroController
http://www.trossenrobotics.com/image...R-90000008.gif Servo
http://www.acroname.com/robotics/par...RIAL-CABLE.jpg Serial Cable
http://www.focusonprice.com/images/JD014.jpg 9V battery
http://www.gesensing.com/thermometri.../ZTP_135SR.jpg InfraRed sensor

More info:

Random vid:
YouTube - While everyone else is revising, I'm building robots

OOpic programmer's guide:
ooPIC Programming Guide Index

OOpic homepage:
OOPic Home Page

Your best friend:
Google
__________________
In a world without walls and fences, you don't need windows or gates.

Last edited by Phoenixs : 08-04-2008 at 07:29 PM.
Phoenixs 15 0FF11|\|3   Reply With Quote
Advertisement
 
Advertisement
Advertisement Sponsored links


Old 08-04-2008, 07:29 PM   #2 (permalink)
duckduckgoose
Infraction magnet
Senior Member
Gold Member

Inquisitor
 
duckduckgoose's Avatar
 
Join Date: Jun 2004
Location: In a van down by the river.
Posts: 4,023
duckduckgoose is a splendid one to beholdduckduckgoose is a splendid one to beholdduckduckgoose is a splendid one to beholdduckduckgoose is a splendid one to beholdduckduckgoose is a splendid one to beholdduckduckgoose is a splendid one to behold
Default

Where are the wheeling blades of death? The piston powered pick axes? Where the hell is the flamethrower?
This is no robot, this is a gaybot.
__________________

Somehow it feels I'm getting more frustrated
With every tongue tied, wild eyed, overrated
Narcissistic, self absorbed spawn of generation whore.
duckduckgoose 15 0FF11|\|3   Reply With Quote

Old 08-05-2008, 06:37 PM   #3 (permalink)
Phoenixs

Heretic
 
Phoenixs's Avatar
 
Join Date: Jul 2008
Posts: 29
Phoenixs is on a distinguished road
Default

Quote:
Originally Posted by duckduckgoose View Post
Where are the wheeling blades of death? The piston powered pick axes? Where the hell is the flamethrower?
This is no robot, this is a gaybot.
Sure! I will add that kind of equipment immediatily.
__________________
In a world without walls and fences, you don't need windows or gates.
Phoenixs 15 0FF11|\|3   Reply With Quote

Old 08-06-2008, 01:47 AM   #4 (permalink)
ghostboy78

Disciple
 
ghostboy78's Avatar
 
Join Date: Dec 2005
Location: Oak Harbor, Washington
Posts: 504
ghostboy78 is on a distinguished road
Send a message via MSN to ghostboy78
Default

This actually looks pretty sick, I might go and build one...
ghostboy78 15 0FF11|\|3   Reply With Quote

Old 08-06-2008, 08:22 AM   #5 (permalink)
Phoenixs

Heretic
 
Phoenixs's Avatar
 
Join Date: Jul 2008
Posts: 29
Phoenixs is on a distinguished road
Default

Quote:
Originally Posted by ghostboy78 View Post
This actually looks pretty sick, I might go and build one...
Yeah I recommend it. I've already enjoyed my project alot

Imo hardest part on project is to make design. Body, wheels etc. It's not that easy as it sounds.

Programming is made pretty easy by OOPic.
__________________
In a world without walls and fences, you don't need windows or gates.
Phoenixs 15 0FF11|\|3   Reply With Quote

Old 08-06-2008, 08:57 AM   #6 (permalink)
kds
MENOS EL OSO
Senior Member
Moderator

Saint
 
kds's Avatar
 
Join Date: Sep 2004
Location: South suburbs of Chicago, Illinois
Posts: 6,284
kds has a reputation beyond reputekds has a reputation beyond reputekds has a reputation beyond reputekds has a reputation beyond reputekds has a reputation beyond reputekds has a reputation beyond reputekds has a reputation beyond reputekds has a reputation beyond reputekds has a reputation beyond reputekds has a reputation beyond reputekds has a reputation beyond repute
Default

I did this in my highschool Java class junior year, but never worked on it after that. this looks pretty fun
kds 15 0FF11|\|3   Reply With Quote

Old 08-29-2008, 02:24 AM   #7 (permalink)
zonemikel

Advocate
 
Join Date: Jul 2007
Location: TeXaS
Posts: 230
zonemikel will become famous soon enough
Default

Nice, you should build your own from scratch using stuff like drill motors and such. You can also make a coilgun pretty easily and attach it to the top (set it off with a relay). Never heard of ooPic i use asm and pic-c, i pretty much use asm because of my love for it.

Good job though, i mess with this stuff alot, so if you post more stuff in this areana ill be interested.
__________________
Go to the Beginning . . . Continue till the end . . . when you get to the end, stop.

"Socrates concluded he was indeed the wisest man, if only because he knew he was ignorant. Then as now, this is the cardinal rule of intelligence analysis: we take from it what we bring to it: our fears and hopes, selfish biases and selfless concerns, our insight and blindness."



zonemikel 15 0FF11|\|3   Reply With Quote

Old 08-30-2008, 11:11 AM   #8 (permalink)
Phoenixs

Heretic
 
Phoenixs's Avatar
 
Join Date: Jul 2008
Posts: 29
Phoenixs is on a distinguished road
Default

Sure. But currently I'm working with content management system in php and mysql.

Let's see if I add something when I finish that project :P
__________________
In a world without walls and fences, you don't need windows or gates.
Phoenixs 15 0FF11|\|3   Reply With Quote

Old 09-01-2008, 02:43 AM   #9 (permalink)
CrazyGerbilEater

High Priest
 
CrazyGerbilEater's Avatar
 
Join Date: Jul 2005
Location: I...Dont...Know...
Posts: 1,791
CrazyGerbilEater is a jewel in the rough
Send a message via MSN to CrazyGerbilEater
Default

im waiting to build mine until i have enough free time...and energy.

itll be a wood box nailed together with a lawnmower engine, and a compresser built in. im planning on a nail gun or two, and a napalm-grenade launcher(my plastic cup design with a air powered tube launcher). ill put a thin coating of metal on the outside. itll be a monster!! id put a chair in it, but i dont feel like committing suicide.

battlebots, those shows were awesome, i dont see them on anymore though.
__________________
Woot
CrazyGerbilEater 15 0FF11|\|3   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Advertisement

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Hydra Project: An Anti-Piracy Proof BitTorrent Tracker gamepin126 General Chat 20 12-08-2007 08:33 AM
Map Request Titan Mods & Maps 15 12-02-2007 10:20 PM
Project help Super General Chat 12 01-07-2007 09:17 AM
Huge Project Recommendations/Opinions/Thoughts lpxxfaintxx Hardware and Software 5 03-04-2006 11:23 AM


All times are GMT. The time now is 08:24 PM.


vBulletin style developed by Transverse Styles

Powered by vBulletin Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
Copyright © 2004-2008 BWHacksAd Management by RedTyger