go away spammer

Author Topic: Any room for C++ programmers?  (Read 2054 times)

0 Members and 1 Guest are viewing this topic.

Offline greywanderer012345Topic starter

  • Robot Overlord
  • ****
  • Posts: 133
  • Helpful? 2
Any room for C++ programmers?
« on: September 11, 2010, 06:46:51 PM »
I've been programming in c++ for several years as a hobby, making and modding games and such. I stumbled upon SoR and I am very motivated to start building robots, but from the looks of it, c++ is too heavy for microcontrollers. I'm leaning toward using avr based microcontrollers, since the programming is in C. What I'm wondering is where to go with learning the programming skills. I've never programmed in C without the ++. All I really know to be different is the lack of classes in C. Is there anything else I should know about? Is it possible to use C++? Do I need to start fresh with C, or do I already have most of what I need by knowing C++? Thanks, everyone.

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
    • Ro-Bot-X Designs
Re: Any room for C++ programmers?
« Reply #1 on: September 11, 2010, 06:58:43 PM »
Take a look at Arduino. That is C/C++ embeded programming.
Check out the uBotino robot controller!

Offline greywanderer012345Topic starter

  • Robot Overlord
  • ****
  • Posts: 133
  • Helpful? 2
Re: Any room for C++ programmers?
« Reply #2 on: September 11, 2010, 07:26:17 PM »
I should mention that I really want to be able to make my own microcontroller boards. I don't want to just buy a premade one. So, Arduino is free, C-based, and pretty easy to use? And I don't have to buy a programmer, right? if I buy mcu's with the arduino bootloader? As long as all that is the case, I think I understand arduino as an option, except maybe whether or not I need to put a usb connection on my board to use arduino...? What else is there to consider though? Can I buy an atmega with some OTHER bootloader, like the one in the SoR tutorials? Are there other things that I'd want a programmer for? Is it worth it to just go ahead and invest the $~30 in one?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Any room for C++ programmers?
« Reply #3 on: September 11, 2010, 07:42:56 PM »
If your making your own boards then don't forget that they come 'blank' - ie with no bootloader. So you would need to have a hardware programmer like the AVRISP MkII to load anything onto a fresh chip - including a bootloader
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Hawaii00000

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 347
  • Helpful? 2
Re: Any room for C++ programmers?
« Reply #4 on: September 11, 2010, 07:45:15 PM »
Arduino has a big community. Its very easy to use (no programmer needed).

I think the tutorial your talking about is the $50 robot. If you plan to build your own microcontroller board this is the way to go. I believe you will need a programmer for this, but I may be wrong.
"God chose to make the world according to very beautiful mathematics."
-Paul Dirac
**************************************************************
Its Hawaii Five-O. Get it?

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
    • Ro-Bot-X Designs
Re: Any room for C++ programmers?
« Reply #5 on: September 11, 2010, 07:46:01 PM »
I have a hardware programmer (this one is the best, as it have the FTDI cable integrated). And I design my own Arduino compatible boards. I just buy blank chips and install Arduino bootloader, then use a FTDI cable to program them directly from Arduino software.

BTW, the FTDI cable is just a serial connection through the USB port.
« Last Edit: September 11, 2010, 07:48:27 PM by Ro-Bot-X »
Check out the uBotino robot controller!

Offline greywanderer012345Topic starter

  • Robot Overlord
  • ****
  • Posts: 133
  • Helpful? 2
Re: Any room for C++ programmers?
« Reply #6 on: September 14, 2010, 04:04:10 PM »
OK, I think I'm going to go ahead and buy the programmer. Still though, does anyone know if C++ can be used to program an avr mcu?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Any room for C++ programmers?
« Reply #7 on: September 14, 2010, 04:30:59 PM »
Yes you can use C++.

The member tutorials section has a VERY early version of WebbotLib that was in C++ - ready to download.

The reason I moved from C++ to C was partly that 'the community' was more familiar with C and also that the debugging/simulator support in AVRStudio is fairly non-existent for C++.

Some people may say that C++ is 'too slow', or 'creates bigger programs' but ignore those comments as they just aren't true.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline garrettg84

  • Robot Overlord
  • ****
  • Posts: 187
  • Helpful? 8
  • Armchair Roboticist Extraordinaire
    • http://www.garrettgalloway.com/
Re: Any room for C++ programmers?
« Reply #8 on: September 14, 2010, 04:38:21 PM »
I'm not sure which features of C++ it is that you desire to use when programming micro controllers, but if it is just the fact that you are already familiar with C++, C should feel like home. Here is a good little mini-article on the pitfalls you may experience: http://www.eecs.umich.edu/~sugih/pointers/C++NotInC.html

C and ASM are the only languages "officially" supported that I am aware of. There is a minimal python implementation that allows python bytecode execution on AVR mega series micro controllers. This python implementation is rather new and not ready for commercial use.

Good luck with your new endeavor. Which programmer have you decided on?
-garrett

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Any room for C++ programmers?
« Reply #9 on: September 14, 2010, 04:48:04 PM »
C and ASM are the only languages "officially" supported that I am aware of. ?

Sorry - but thats 'just wrong'.

WinAVR comes with gcc compiler support for ASM, C and C++

Many libs use elements of C++ including those from Pololu and Arduino.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline garrettg84

  • Robot Overlord
  • ****
  • Posts: 187
  • Helpful? 8
  • Armchair Roboticist Extraordinaire
    • http://www.garrettgalloway.com/
Re: Any room for C++ programmers?
« Reply #10 on: September 14, 2010, 05:58:14 PM »
C and ASM are the only languages "officially" supported that I am aware of. ?

Sorry - but thats 'just wrong'.

WinAVR comes with gcc compiler support for ASM, C and C++

Many libs use elements of C++ including those from Pololu and Arduino.

I stand corrected, thank you Webbot. (by the way check out Webbot's posts, he is one hell of a resource)

http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_cplusplus
I was basing my information off of the above link. That site may very well be outdated. Yes, avr-gcc will compile C++ source code. However the libstdc++ library is not included. According to the site, there are also a few operators that are not implemented like 'new' and 'delete' but it was suggested this could be fixed.

Please take my information with a grain of salt. Webbot is by far more experienced and familiar with the development platform, I am just a newb =)
-garrett

Offline greywanderer012345Topic starter

  • Robot Overlord
  • ****
  • Posts: 133
  • Helpful? 2
Re: Any room for C++ programmers?
« Reply #11 on: September 25, 2010, 05:30:15 PM »
Ok. I'm going to do some experiments to find out whether it's worth it to use c++ instead of c. I'm very used to how c++ works, but I think I could switch to C pretty easily. Thanks everyone!

 


Get Your Ad Here

data_list