If this code was compiled to an *.exe-file, I'll guess it would work. But I do not think you could get the PIC 18F4220 to do something useful with it.Rich (BB code):#include <stdio.h> { printf("To C, or not to C: that is the question.\n"); return 0; }
Well, I think it matters. Read the datasheet to the PIC18F4220. There you will find lots of info.I started a project using project wizard. picked the PIC18F4220 although I don't think it matters too much, selected HI-TECH Universal Toolsuite and then I attached my file containing the code to my project under source file. Then I attempted to build the project but for some reason it failed.
#include <stdio.h>
int main()
{
printf("To C, or not to C: that is the question.\n");
return 0;
}
#include <stdio.h>
void main(void)
{
printf("To C, or not to C: that is the question.\n");
while(1)
{
}
}
Doh...Feeling quite stupid!I am quite surprised no one pointed out one flaw from the code you posted earlier mind. You're missing a 'main' function in your little snippet..
BASIC is not a good language to start with unless it's the only language you ever intend to learn! But I think most people would agree that C is the basis of most modern languages and a good foundation.I would say C but it's like driving a fast motorcycle on a twisty mountain road at first, it takes a while to get in the zone. So a training wheel language like BASIC would be a good choice for a total beginner.
http://www.sfcompiler.co.uk/swordfish/download/index.html
EXcept that every cpu has it's own instruction set and every implementation of a given cpu has it's own memory map and hardware IO routines!epic_newb said:A teacher I used to know always talked about how assembly is the best language because it is such a basic machine language. I tried learning it but that didn't work out well. I think learning "C" first will allow me to learn it in the future if i need to.