Society of Robots - Robot Forum

Software => Software => Topic started by: zackshalac on April 26, 2008, 10:59:12 PM

Title: what language?
Post by: zackshalac on April 26, 2008, 10:59:12 PM
I'm thinking about getting into building some kind of robot, just for fun, and i want to know what programming language to learn.  I'm thinking about learning either BASIC or C.  I know the basics of BASIC from my TI-83 calculator ;), and i took an on line tutorial for c++ and made some lame programs with it.  I'm sorta leaning to BASIC because that sounds easier to learn, but i want to know what limitations it has.

thanks
Title: Re: what language?
Post by: Private Reid on April 26, 2008, 11:58:15 PM
i program with "c"

it's easier then "c++"

not sure about "BASIC" though
Title: Re: what language?
Post by: benji on April 27, 2008, 03:12:35 AM
if you want to learn how the microcontrollers work start with a low level language,, like assembly, , then move to a higher level language
Title: Re: what language?
Post by: Admin on April 27, 2008, 01:44:31 PM
http://www.societyofrobots.com/robot_faq.shtml#robot_language
Title: Re: what language?
Post by: zackshalac on April 27, 2008, 07:20:38 PM
thanks for the link to the c tutorial, i think that will be the language i pick, but where can i learn robotics specific programming, such as inputing from sensors and outputting to motors?  Is this something that will come in the microproccesor manual?
Title: Re: what language?
Post by: Steve Joblin on April 27, 2008, 07:32:06 PM
I would actually go the other way... I would start with BASIC, then move to more powerful and advanced laguages like C.  I would look at Parallax's BOEBot... the materials walk you through the basics of BASIC and the basics of robotics.
Title: Re: what language?
Post by: JesseWelling on April 27, 2008, 11:52:59 PM
I would start with C. If you can think in C code you can think in any programing language, even if it's Object Oriented (because you should be making OO in C in any case...)

Well... any language except for LISP  :P
Title: Re: what language?
Post by: lemontree on April 29, 2008, 08:37:08 AM
I have recently looked at basic again after 25 years. I am surprised to find that it is still a very viable programming language. I downloaded Freebasic from www.sourceforge.net (http://www.sourceforge.net).  There is definitely a limit to the complexity of the programs you can write, but you can still do very much.  The keywords in basic are very intelligently selected, and put many modern programming languages to shame.  I started programming using basic and then assembly language on an 8 bit computer.
Title: Re: what language?
Post by: Kitsune on June 23, 2008, 12:17:00 AM
I find Java easy to use
Title: Re: what language?
Post by: Cotowar on July 08, 2008, 10:28:08 PM
I am no expert on building robots, and the hardware side of electronics is definitely my weakside, but as far as software and programming are concerned, I believe I can help you out.

You will probably want to start with BASIC, or better yet, VisualBASIC, so you can learn the more advanced concepts of programming with plain text. After that, you should be fine to learn C++ or Java. Most languages have the same concepts, its just the syntax that separates them. To be honest, I find Java easier to use than C++, but its really a matter of preference. I have noticed several minor shortcomings to all the languages I've learned so far, but overall I would say Java is probably the most capable and practical language to use.

If you wanted to be a badass, you could try doing it in FORTRAN. its similar in syntax to C, but is way older and a lot less capable. kind of fun if you're looking for an extra challenge.

Bottom line, I'd go with Java. Cheers.
Title: Re: what language?
Post by: krich on July 09, 2008, 11:10:15 AM
thanks for the link to the c tutorial, i think that will be the language i pick, but where can i learn robotics specific programming, such as inputing from sensors and outputting to motors?  Is this something that will come in the microproccesor manual?

Good choice.  Most of your C compilers allow you to do some inline assembly, so you get some exposure to that language as well, if you choose to pursue it.

You'll find a number of tutorials on the Internet that will go through some of the basics.  You haven't said what microprocessor you'll be using for your robot project, so I'll just tell you about Atmel's AVRs since that's what I use. 

First, there's a great website called Society of Robots (http://www.societyofrobots.com/)  ;D , check out all of the tutorial sections and download the code examples.  There is much to be learned from simply looking at a code example.

Second, learn how sensors and motors are connected to your robot.  This will give you a better understanding of what you need to learn on the programming side.  Sensors typically use the ADC, so learn what that is.  Motors use digital outputs with PWM and require a motor driver circuit, so learn all about that.  If you don't understand the concepts, you have no chance of programming it successfully.

Finally, head over to AVR Freaks (http://www.avrfreaks.net/) once you know what you want to do.  Take a look at the forums, and find the Tutorial forum.  In that forum, folks have posted comprehensive tutorials on a wide variety of topics.  Some are very basic, which is good for learning, others are way over my head.

Post here on SoR forums if you have any questions.  The folks here are a friendly bunch...they've endured my newbish questions quite well.

Good luck.