Loading a NerdKit sketch on my Arduino

Hi,

I was wondering if it was possible to load an .c file (this one from this NerdKit tutorial) with the Arduino GUI?

I am trying to bulind this heart with a Arduino i have built my self on a breadboard, and was thinking that I could program the MCU by replacing the one on my original Arduino-board..

When I am trying i get this error:

In function 'void twinkle()':
error: expected primary-expression before '.' token In function 'int main()':

You want to post the corresponding code? :) Mowcius

void twinkle(){
   FILE uart_stream = FDEV_SETUP_STREAM(uart_putchar, uart_getchar, _FDEV_SETUP_RW);

So, what is a FILE on the Arduino?

Sorry i am on ny iPhone right now, so i cant paste the code, but here is s link to the file: http://www.nerdkits.com/videos/ledheart/ledheart.c

In function 'void twinkle()': error: expected primary-expression before '.' token In function 'int main()':

The twinkle function has a variable, uart_stream, whose type is FILE. There ain't no such thing on the Arduino.

The twinkle function is called by main. The Arduino IDE defines a main function, so the main function in this code would be a duplicate definition.

I do not understand very much of the coding quite yet, so i cant really figure out what that means.. But is it possible to write the code more Arduino friendly? It is designed to run on a Atmega168, but to be programmed with some other program that I havent got to work yet..

The twinkle function has a variable, uart_stream, whose type is FILE. There ain't no such thing on the Arduino.

Couldn't you include stdio.h, like can be done for printf, in order to get the FILE functionality?:

http://www.arduino.cc/playground/Main/Printf

It would eat memory, and I don't know if other special headers would be needed for other things...

:)

Thats plain C for an avr, compile it using avr-gcc.

I am not experienced enough yet to know how to do what Senso here is saying.. :-? Wil I be able to connect to my MCU's thrugh fex. AVR studio with this? Then it would be no problem uploding the code if I am right..?

Thanks for helping out guys!

Give a look here: http://www.smileymicros.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=70&MMN_position=117:117 ;)

I havent quite figured out this yet..

Is there anyone ho knows if I am able to build a standalone microcontroller with no bootlaoder and load it with this .c-file so that i can build this LED-heart? Do I need a ISP-programmer? If so, will this work?

Thankful for any help!

You can port all the code to arduino code and make it work, you would learn a lot doing that and it shouldn't be that hard, and every time you have doubts just ask here ;)

i am having similar problems of this error message of FILE uart_stream = FDEV_SETUP_STREAM(uart_putchar, uart_getchar, _FDEV_SETUP_RW); can you please tell me how you went about yours :)

Endee: Read the information I pointed out in my previous comment.

I would think doing something similar to how you can implement the printf() functionality would work in this case (at the expense of memory)...?

:-?