Basic microcontroller stuff
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- nobody6.1
- Posts: 1
- Joined: Sat Jun 14, 2008 1:09 pm
Basic microcontroller stuff
I am a computer literate electronics hobbyist, although I have no programming experience. I want to learn how to program microcontrollers, and am considering buying a boarduino. Are there any books or websites you can suggest to help me learn how to use a microcontroller? Should I learn some programming and then buy the controller, or buy the controller now and learn by doing? Would an arduino be a good controller to learn on?
-
- Posts: 47
- Joined: Sat Jun 07, 2008 6:36 am
ladyada.net has all kinds of resources, just click around. arduino.cc is the homepage for the arduino itself, and they have a very useful wiki set up there.
Programming itself is best learned the hard way with the tools in front of you. The arduino site has a language reference that I almost always have open, and a lot is copy & paste-able (which is a bad thing, actually).
If you're really worried about programming, learn some java (very practical to learn but useless with AVRs) or C (the arduino language is similar to both). AVRs are most commonly programmed with C or C++, but the arduino environment has it's own language based on Processing (a language made for AVRs).
I personally have known how to program for a long long time now, and it really doesn't matter what languages you learn as long as you fully understand HOW and WHY it works the way it does (that stuff doesn't change across languages). If you just want to get your feet wet with programming, a scripted language like PHP, ruby, perl, or python would be a good start. STAY AWAY FROM BASIC AT ALL COSTS! BASIC was my first language and I regret every moment of it :\
As for what to buy, my first microcontroller was the boarduino, and I'm very happy with that decision.
Programming itself is best learned the hard way with the tools in front of you. The arduino site has a language reference that I almost always have open, and a lot is copy & paste-able (which is a bad thing, actually).
If you're really worried about programming, learn some java (very practical to learn but useless with AVRs) or C (the arduino language is similar to both). AVRs are most commonly programmed with C or C++, but the arduino environment has it's own language based on Processing (a language made for AVRs).
I personally have known how to program for a long long time now, and it really doesn't matter what languages you learn as long as you fully understand HOW and WHY it works the way it does (that stuff doesn't change across languages). If you just want to get your feet wet with programming, a scripted language like PHP, ruby, perl, or python would be a good start. STAY AWAY FROM BASIC AT ALL COSTS! BASIC was my first language and I regret every moment of it :\
As for what to buy, my first microcontroller was the boarduino, and I'm very happy with that decision.
- darus67
- Posts: 246
- Joined: Wed Sep 26, 2007 10:25 pm
I have to disagree on a few points.
If you want to lean to program microcontrollers, stay away from java.
In microcontroller programming you have to be very aware of memory
management. Java hides all of those details from you so you.
Basic was the first language I learned. I don't see anything wrong with it
as a starting point for someone who has no previous experience in programming.
Just don't expect to do much with it other than learn to program.
The Arduino language is just C. I don't know why everyone says it uses its
own language.
If you want to lean to program microcontrollers, stay away from java.
In microcontroller programming you have to be very aware of memory
management. Java hides all of those details from you so you.
Basic was the first language I learned. I don't see anything wrong with it
as a starting point for someone who has no previous experience in programming.
Just don't expect to do much with it other than learn to program.
The Arduino language is just C. I don't know why everyone says it uses its
own language.
-
- Posts: 47
- Joined: Sat Jun 07, 2008 6:36 am
http://www.arduino.cc/en/Reference/HomePage says it's "based on C/C++" which really could mean anything. Another page says it's based on Processing/Wiring too. There's another page on the wiki that actually has examples from C, C++, Java, and 'arduino', and most things are very different. Array declarations for example.
Yes, Java has nothing to do with µC programming but that doesn't change the fact that it's a great first language. So far I haven't had to do garbage collection with 'arduino'....
Yes, Java has nothing to do with µC programming but that doesn't change the fact that it's a great first language. So far I haven't had to do garbage collection with 'arduino'....
-
- Posts: 36
- Joined: Thu May 15, 2008 9:38 pm
Personally to try out some programming I would recommend either C++ or C, they would provide a firm start for the arduinado.
I started programming with basic on my TI-84+ graphing calculator (unfortunately basic), and then I started C++. I would recommend buying a hefty 400+ page book from your local bookstore to help get started.
I wouldn't really know which to choose , because if you ever want to program on the computer Visual C++ is a lot better then C, but when it comes to microcontrolers C is used a lot more then C++, It really depends on if you are going to learn programming for microcontrollers or computers.
I started programming with basic on my TI-84+ graphing calculator (unfortunately basic), and then I started C++. I would recommend buying a hefty 400+ page book from your local bookstore to help get started.
I wouldn't really know which to choose , because if you ever want to program on the computer Visual C++ is a lot better then C, but when it comes to microcontrolers C is used a lot more then C++, It really depends on if you are going to learn programming for microcontrollers or computers.
-
- Posts: 36
- Joined: Thu May 15, 2008 9:38 pm
I have to say Microsoft can be pretty good sometimes, I personally love msdn.com it helps make programming so much easier.mngrif wrote:For the love of all that is holy stay away from microsoft's BANNED. Get used to a text editor and a command line early, it'll save you more pain than not learning BASIC!
-
- Posts: 47
- Joined: Sat Jun 07, 2008 6:36 am
If it works for you, then by all means use it!
It's just that while QBASIC was the easiest thing I've ever learned, every other language has been oh so very hard. Then again, I was like 7 when I learned QBASIC and language (spoken or written) is very easy to learn for the young mind. It wasn't until I was 11 or so that I bothered to learn any other languages 'cause that's when I was shown the glory that is Linux & BSD.
VisualWhatever is obviously good stuff since it sells oh so very well. The Free version of msdn exists on most any default GNU/Linux install anyway in the form of manpages. All standard libc libraries have their own manpage so figuring out what ioctl() does is as simple as "man ioctl" at a shell prompt (ubuntu users need manpages-dev to get them). For hyperlinked versions of the manpages, look in to 'infopages'. It's the new format that hasn't quite caught on as well as it should have.
I gave up 100% on VisualWhatever.NET when msdn was nothing but a link farm of 404'd pages a few years ago, much like the windows update knowledgebase still is. The lack of FF compatibility back then was a massive turn-off too. At least I gave it a shot.
*cough* Sorry, I'll stop ranting... Really though, it isn't a question of what's better than what, it's a question of what works best for you. If anyone has something to say to me about it, keep it to PM since we're already waaaaay off topic here. Or start up a flame war in the Ramblings section :P
It's just that while QBASIC was the easiest thing I've ever learned, every other language has been oh so very hard. Then again, I was like 7 when I learned QBASIC and language (spoken or written) is very easy to learn for the young mind. It wasn't until I was 11 or so that I bothered to learn any other languages 'cause that's when I was shown the glory that is Linux & BSD.
VisualWhatever is obviously good stuff since it sells oh so very well. The Free version of msdn exists on most any default GNU/Linux install anyway in the form of manpages. All standard libc libraries have their own manpage so figuring out what ioctl() does is as simple as "man ioctl" at a shell prompt (ubuntu users need manpages-dev to get them). For hyperlinked versions of the manpages, look in to 'infopages'. It's the new format that hasn't quite caught on as well as it should have.
I gave up 100% on VisualWhatever.NET when msdn was nothing but a link farm of 404'd pages a few years ago, much like the windows update knowledgebase still is. The lack of FF compatibility back then was a massive turn-off too. At least I gave it a shot.
*cough* Sorry, I'll stop ranting... Really though, it isn't a question of what's better than what, it's a question of what works best for you. If anyone has something to say to me about it, keep it to PM since we're already waaaaay off topic here. Or start up a flame war in the Ramblings section :P
-
- Posts: 36
- Joined: Thu May 15, 2008 9:38 pm
Well, while were off topic...mngrif wrote:If it works for you, then by all means use it!
It's just that while QBASIC was the easiest thing I've ever learned, every other language has been oh so very hard. Then again, I was like 7 when I learned QBASIC and language (spoken or written) is very easy to learn for the young mind. It wasn't until I was 11 or so that I bothered to learn any other languages 'cause that's when I was shown the glory that is Linux & BSD.
VisualWhatever is obviously good stuff since it sells oh so very well. The Free version of msdn exists on most any default GNU/Linux install anyway in the form of manpages. All standard libc libraries have their own manpage so figuring out what ioctl() does is as simple as "man ioctl" at a shell prompt (ubuntu users need manpages-dev to get them). For hyperlinked versions of the manpages, look in to 'infopages'. It's the new format that hasn't quite caught on as well as it should have.
I gave up 100% on VisualWhatever.NET when msdn was nothing but a link farm of 404'd pages a few years ago, much like the windows update knowledgebase still is. The lack of FF compatibility back then was a massive turn-off too. At least I gave it a shot.
*cough* Sorry, I'll stop ranting... Really though, it isn't a question of what's better than what, it's a question of what works best for you. If anyone has something to say to me about it, keep it to PM since we're already waaaaay off topic here. Or start up a flame war in the Ramblings section
I'm dual booting ubuntu and I have to say I do like it, but unfortunately my speakers, and internal wifi card don't work. Seeing as I have a laptop this is a big problem for me.
Any attempt at fixing this just makes my brain hurt
-
- Posts: 373
- Joined: Tue Mar 06, 2007 11:51 pm
-
- Posts: 47
- Joined: Sat Jun 07, 2008 6:36 am
Pretty much with Ubuntu 8.04 (and without any debugging infos for me to help) if it doesn't work after going through the 'restricted drivers' howtos it isn't supported. There is the odd card that doesn't have drivers that will still work with ndis-wrapper though.
For more help with this, go ask on the Ubuntu forums or PM me the output of 'dmesg' and 'lspci' after a fresh boot (the Ubuntu guys will want this information too). If you have a wifi kill switch, hit it a few times first.
LOL, I just realized the OP has only made that one post!
For more help with this, go ask on the Ubuntu forums or PM me the output of 'dmesg' and 'lspci' after a fresh boot (the Ubuntu guys will want this information too). If you have a wifi kill switch, hit it a few times first.
LOL, I just realized the OP has only made that one post!
-
- Posts: 1119
- Joined: Wed Jun 13, 2007 9:17 am
SciTE/Scintilla is the ONLY text-editor you should EVER use. I absolutely LOVE that.
And as for staying away from Java, that's probably good advice, while it teaches you the structure of programming that will help you will C(++), you don't learn a whole lot about the kind of things you'll need for microcontrollers. So learn C or C++ early, if you're haveing a hard time jumping into that, start with HTML/Javascript or Python
And as for staying away from Java, that's probably good advice, while it teaches you the structure of programming that will help you will C(++), you don't learn a whole lot about the kind of things you'll need for microcontrollers. So learn C or C++ early, if you're haveing a hard time jumping into that, start with HTML/Javascript or Python
Please be positive and constructive with your questions and comments.