NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » trouble with led_blink project
November 11, 2009 by Craig_H |
Hi, I seem to have an issue compiling the code for the blinking led project. I got through the temperature sensor projects well, but when going the next step, it appears the led_blink code was not included in the zip file I downloaded. So I copied the c and makefile code exactly as it was shown in the guide (substituting COM4 where appropriate). However, when I tried to compile I get an error that in function 'main' DDRC, PC4 and PORTC are all undeclared. By that I gather that somehow the file that would declare all the registers and pins is not getting included properly but I'm at the limit of my knowledge now. Thanks in advance for any assistance, Craig. |
---|---|
November 11, 2009 by hevans (NerdKits Staff) |
Hi Craig, The led_blink Code should be included in the zip file you download from our site. We recently switched to a version of the guide that includes this mini led_blink tutorial, so it is possible you have an outdated version of the Code folder. If you donwload a new version, it should be there. I took a closer look to find what caused your problem however. There is a typo in the picture of the Makefile on page 68. The top line that reads GCFLAGS should be GCCFLAGS, the second C is missing. Which explains why gcc was not getting all the definitions for the pin numbers since it is the -mmcu flag that lets it know which chip it is compiling for. Hope that helps, let me know if it still doesn't work. Humberto |
November 12, 2009 by Craig_H |
Humberto, Thanks for the quick reply. I opened the zip file and found the led_blink files there. After comparing the text in the guide with the downloaded code, I discovered that the problem was that the guide's text for the led_blink.c code is missing one line: '#include <avr/io.h>' I added that line to the code I already wrote and presto -- blinking led light! Thanks for helping me through the issue. Regards Craig. |
November 12, 2009 by hevans (NerdKits Staff) |
Hi Craig, Thanks for pointing out that issue. I have fixed both the Makefile typo and the missing include statement in the guide. Let us know if you run into any more problems. Humberto |
Please log in to post a reply.
Did you know that you can read diagnostic data from some cars with a NerdKit? Learn more...
|