Author Topic: C++ tutorials.  (Read 1042 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr. NinjaTopic starter

  • Jr. Member
  • **
  • Posts: 35
  • Helpful? 0
C++ tutorials.
« on: May 16, 2012, 03:32:34 PM »
Hello,

I'm looking to build a four legged robot (I'm new to this, aside from the Internet  :P) that follows a light, and auto-adjusts for its balance (the centre part, with the board). I would like to learn C++ for this, but I need to learn it first. I found a website, www.cprogramming.com, but when I tried to compile it, it didn't work, so I would like to find a tutorial that another person who has tried it and had success.

Also, once this issue is resolved, I would like to find the code that would be necassary to include an 8 axis speedometer, also, how to develop the code necessary to use LEDs to detect light.

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: C++ tutorials.
« Reply #1 on: May 17, 2012, 02:22:04 AM »
Hi there  :)

I'm looking to build a four legged robot (I'm new to this, aside from the Internet  :P) that follows a light, and auto-adjusts for its balance (the centre part, with the board).
Only my opinion, but if You've never built robot before, go for wheeled robot rather than the one with legs. As You mentioned light following bot, then The $50 Robot is what you're looking for.

I would like to learn C++ for this, but I need to learn it first.
To start with - C++ concepts will not do any good in microcontroller programming, moreover, I don't think there are C++ compilers for microcontrollers. What You probably want to learn is C. Other reasonable choices might be: ASM and C# (.NET). Currently, C is very popular, widely adopted, plus, You can find many cheap microcontrollers that come with C compiler.

I found a website, www.cprogramming.com, but when I tried to compile it, it didn't work, so I would like to find a tutorial that another person who has tried it and had success.
I used these C++ Language Tutorials to learn. Failed compilation might not necessarily be because code is wrong, it is very common to have wrong compiler/IDE setup. What compiler/IDE do You use? What errors do You get?

Also, once this issue is resolved, I would like to find the code that would be necassary to include an 8 axis speedometer [...]
I'm not sure if such thing exists  ;D Don't You mean 3-axis accelerometer, or 3-axis Gyro, or combination of both?  ;)

[...] how to develop the code necessary to use LEDs to detect light.
I'm not sure You can do that, as LEDs (Light Emitting Diodes) emit light and don't detect it. What You're looking for is photocell, or photo-diode; take a look at the robot tutorial I linked You to.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline billhowl

  • Supreme Robot
  • *****
  • Posts: 375
  • Helpful? 32
  • Your success is in your hands.
Re: C++ tutorials.
« Reply #2 on: May 17, 2012, 03:57:56 AM »

I would like to learn C++ for this, but I need to learn it first.
To start with - C++ concepts will not do any good in microcontroller programming, moreover, I don't think there are C++ compilers for microcontrollers. What You probably want to learn is C. Other reasonable choices might be: ASM and C# (.NET). Currently, C is very popular, widely adopted, plus, You can find many cheap microcontrollers that come with C compiler.

GNU GCC can compile for both C & C++, the WebbotLib can use for both C & C++.


[...] how to develop the code necessary to use LEDs to detect light.
I'm not sure You can do that, as LEDs (Light Emitting Diodes) emit light and don't detect it. What You're looking for is photocell, or photo-diode; take a look at the robot tutorial I linked You to.

LED can use as Light Detectors too.
http://laser.physics.sunysb.edu/~tanya/report2/
http://arduino.cc/playground/Learning/LEDSensor

Offline Mr. NinjaTopic starter

  • Jr. Member
  • **
  • Posts: 35
  • Helpful? 0
Re: C++ tutorials.
« Reply #3 on: May 17, 2012, 02:39:48 PM »
What I meant by light following robot, is the robot detects the red LED and then follows it. (using its own modified "sensor" LEDs)

By 8-axis I mean it is that there are 8 sides, (one on each leg, and one in-between each leg) and it reads movement from each one of those sides, and adjusts a motor on the legs to keep the centre stabilized. I'm  not really sure how to describe it other than that.

I already have the basic idea, the concept for the robot's movement, I just need to know how to translate that into C(++).

Offline ssri

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Cant find new thread
« Reply #4 on: May 18, 2012, 01:19:14 AM »
I cant find the "start new thread icon"....so i am typing it here....what i wanted to ask is....i have summer holiday 4 a month and half....i am new and intrested in robotics....i know hw to program 8051(i.e.at89c51)....  lil good...and am gd at c++ & c prog....can smbody suggest me what software can i learn online in dis holiday dat wil be useful in robotics and embeded apps......????plz reply sn.................  : :-\ :-\
       

Offline Mr. NinjaTopic starter

  • Jr. Member
  • **
  • Posts: 35
  • Helpful? 0
Re: C++ tutorials.
« Reply #5 on: May 21, 2012, 07:32:16 PM »
As to the above post, the new thread button is on the bottom left side of the list of threads.

I can not edit my post (mobile) and, yes, I meant an accelerometer.

 


Get Your Ad Here

data_list