Society of Robots - Robot Forum
Software => Software => Topic started by: nckspec on March 31, 2008, 01:56:52 AM
-
hello, ive bee looking into the $5o robot code and ive heard that you have to specify the abilities of the microcontroller at the beginning. I don't understand. Do you have to program each microcontroller differently in c or could i use a tutorial for a pic controller with avr atmega8
-
hello, ive bee looking into the $5o robot code and ive heard that you have to specify the abilities of the microcontroller at the beginning. I don't understand. Do you have to program each microcontroller differently in c or could i use a tutorial for a pic controller with avr atmega8
Yes, different microcontroller brands(like pic, atmega or sh) need different codes because their compilers and definitions are very different. The standard C is the same but the address numbers are different and the tags attached to those addresses(through #define) are usually different. With controllers from the same brand(like atmega 88 or atmega 32) sometimes the code can be very simiar(if not the same). So ADMIN's code for the $50 robot will not work on a PIC(he uses an atmega, I think).
-
YOUR ANSWER IS THE LOGIC IS ALWAYS THE SAME,
ITS THE DECLARATION AND SYNTAX THAT DIFFERS , IN PIC THE REGISTER ADRESSES AND NAMES ARE DIFFERENT BUT THE LOGIC WILL ALWAYS BE THE SAME ... SO YES THE ADMIN'S LOGIC "NOT THE COMPLETE CODE" WILL WORK WITH PIC
-
Ok so the loops and all of that stuff in c will work with any controller but when you are controlling the ports its different
-
also how would i know what i need to change when programming a different controller
-
well friend for that u need to learn a little abt embedded c and which registers to access in the type of microcontroller ur using
-
Also what out of the $50 robot code do you need if you were starting from scratch on a different robot. I want to understand the basic structure of the code so I can build on it for different projects.
-
if u want to understand the code then have a thorough reading of the complete codes and header files, the more clear u are abt the code the better will be ur understanding abt the subject..
-
Thank you so much, i read through the $50 robot code and stampy code and now i understand a lot. And I was about to spend $40 on an online tutorial to learn this stuff.