Author
Topic: very confused (Read 2701 times)

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).

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

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.