Author Topic: Language for Robot Control  (Read 2263 times)

0 Members and 1 Guest are viewing this topic.

Offline Builder1Topic starter

  • Jr. Member
  • **
  • Posts: 46
  • Helpful? 0
Language for Robot Control
« on: July 02, 2008, 03:51:09 PM »
Hello Everyone,
I am new to building robots and have never written programs for one. I've read somewhere in this forum that VB can not be used to program a bot, if that is the case, can I use C++? Also ,if my algorithm is too lengthy and can not fit on a micro controller, what other options do I have aside from a laptop? Please respond as best you can, thank you in advance for your time.
« Last Edit: July 02, 2008, 03:58:37 PM by Builder1 »

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
Re: Language for Robot Control
« Reply #1 on: July 02, 2008, 03:58:23 PM »
microcontrollers can only be programmed in assembler. as long as there exists a compiler of your favourite language for the microcontroller of your choice, you can program your microcontroller in that language.

if you run out of space, you can always share tasks between two (or several uc). Memory space and program space cover a broad range, from tiny devices like PIC10 to huge devices like the ATXMEGA or ARMs.

Don't worry, if you never worked with ucs before, there won't be a case yet where you algorithms will even exceed half of the program space.
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline bens

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 331
  • Helpful? 3
Re: Language for Robot Control
« Reply #2 on: July 02, 2008, 04:10:29 PM »
Don't worry, if you never worked with ucs before, there won't be a case yet where you algorithms will even exceed half of the program space.

This might not be true if he's coming from a software engineering background and has some fancy image processing algorithm or something that he wants to implement on a microcontroller.  When I first started using microcontrollers I was using floats all over the place and was then very surprised so suddenly have no programming space left.  It was somewhat of a surprise to learn that my approach to embedded programming would be quite different from my approached programming on computers.

- Ben

Offline Cotowar

  • Full Member
  • ***
  • Posts: 50
  • Helpful? 0
  • Ubuntu for Humans
Re: Language for Robot Control
« Reply #3 on: July 08, 2008, 10:20:04 PM »
depending on what you need the UC to do, you might try looking into a language called brainfuck. im dead serious thats the name, and its a crazy little language, but if you get good at it its very useful.
--Cotowar--

Offline krich

  • Robot Overlord
  • ****
  • Posts: 165
  • Helpful? 0
Re: Language for Robot Control
« Reply #4 on: July 09, 2008, 10:57:58 AM »
Nice... :o

The C language is likely the most common choice for microcontrollers, followed closely by assembly (arguably first), C++, and basic.  AVR has a huge C/assembly based community because the IDE, compiler, and libraries are free.  I suspect the same is true of PIC as well, but I've not used them.

Learning C is certainly a more "transferrable" skill to other programming tasks you may need to do in the future.  Its basics are largely the same across all platforms and there are a few, very comprehensive, and somewhat "standardized" libraries available for a wide variety of platforms.

Interpreted languages generally don't fare well on microcontrollers because they tend to be less efficient from a resource utilization perspective, so languages like java, perl, lisp, etc. are uncommon.

The key is to pick a language where there is a large community of interest for your platform.  This way, you'll find that there are a good number pre-written libraries and code samples to help you learn.

Good luck.

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: Language for Robot Control
« Reply #5 on: July 09, 2008, 05:44:09 PM »
PBASIC is easy to learn, but the Basic Stamp 2 MCU is $50, unless you get the OEM version, or can breadboard the circuit.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,653
  • Helpful? 169
    • Society of Robots
Re: Language for Robot Control
« Reply #6 on: July 19, 2008, 02:12:35 PM »
If you ever run out of memory, you'd typically just get a microcontroller with more memory. With careful programming, memory shouldn't be a problem except on the smallest of microcontrollers.

http://www.societyofrobots.com/robot_faq.shtml#robot_language

Offline LargoLobo

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Re: Language for Robot Control
« Reply #7 on: March 24, 2012, 12:35:35 PM »
It's always best to find a microcontroller that has a related IDE with a compiler. Assembly language is so close to the hardware that it takes a huge amount of steps to do anything and that is frustrating. The most common higher language is C and works well. C++ will likewise probably be supported by your compiler. Now the trick is how simple is the complier and IDE. Microsoft's Visual C# is not an easy IDE to master and will consume a lot of time and effort to learn. For the hobbiest it's better to adopt a package like the Arduino Uno and associated compiler software. You don't have the memory manage and language shell to deal with. You just program in two functional areas (setup and loop). Likewise, there is display and serial interface software like Processing to provide a great interfac to the controller. Both are free. Processing is written in Java, so it has a sophisticated look and feel to it, thus a small learning curve. Bottom line is C/C++ based IDE that match your controller board is what you want. If you have the money, you can adopt the Texas Instruments controller and have it all. The GUI interface is rich and very well planned out. The controllers are much more sophisticated and have nearly infinite cabability (upgrades, auxillary satellite boards, etc.). But, you have to become familiar with a complex assemble code to see the details or wander away from the GUI IDE.

 


Get Your Ad Here