I mean I worked with Arduino DUE. Not really a different source code from that I wrote above. I just had to change them accotding to the Arduino IDE standard. It would have been better,if printf was easily accesible in Atmel Studio 7
The only "trick" in any of that is the FDEV_SETUP_STREAM and the connection to stdout. But as soon as you have made a connection between stdout and a uart_putchar() routine then all the usual stdio.h output routines are connected and ready to use.
The reason it's done like this is that the output could just as easily have been an LCD with LCD_init() and an LCD_putchar() instead. It's up to you what output device you'd like to use.
The same technology also allows for a uart_getchar() and then connecting that to stdin after which all the things like scanf() could be used too.
oops. I wanted to print the 'result ' from my post #47 . Because, I could not get to understand if I have receieved the value that is supposed to be read. The ASF and drivers aree too confusing for such a simple operation, so I tried to do SPI on my own.
I mean I worked with Arduino DUE. Not really a different source code from that I wrote above. I just had to change them accotding to the Arduino IDE standard. It would have been better,if printf was easily accesible in Atmel Studio 7
- Log in or register to post comments
Tophttp://www.nongnu.org/avr-libc/u...
So a minimal AVR program to use something like printf() might be:
The only "trick" in any of that is the FDEV_SETUP_STREAM and the connection to stdout. But as soon as you have made a connection between stdout and a uart_putchar() routine then all the usual stdio.h output routines are connected and ready to use.
The reason it's done like this is that the output could just as easily have been an LCD with LCD_init() and an LCD_putchar() instead. It's up to you what output device you'd like to use.
The same technology also allows for a uart_getchar() and then connecting that to stdin after which all the things like scanf() could be used too.
- Log in or register to post comments
Topoops. I wanted to print the 'result ' from my post #47 . Because, I could not get to understand if I have receieved the value that is supposed to be read. The ASF and drivers aree too confusing for such a simple operation, so I tried to do SPI on my own.
- Log in or register to post comments
TopPages