You will need to the I/O library
#include <stdio.h>
You will need to link printf to the USART
fdevopen((void*) Usart_Tx, (void*) Usart_Rx);
You will then need to provide the low level "get a byte to/from the USART
routines (called Usart_Tx and Usart_Rx above)
YOu will also need to init the USART to the correct baud rate.
You might want to get a copy of the AVR Butterfly demo program that was
ported to WinAVR and look at UART.h and UART.c for examples of Usart_TX,
Usart_Rx, and the USART init routine.
-Mike
----- Original Message -----
From: "Bryan Martin" <registration@myplaceinspace.com>
To: <AVR-Chat@yahoogroups.com>
Sent: Wednesday, January 23, 2008 6:04 PM
Subject: [AVR-Chat] Simple casting winavr
>I am attempting to move to C (winavr) from bascom for programming but
> getting hung up on some fundamentals.
>
> Given the following
>
> unsigned char byte_in = 0xA;
>
> I need to print the decimal value to UART so I want to see 10. Similar to
> printf("%d", byte_in). Lord I hope this makes sense.
>
> Poor planning on your part does not constitute an emergency on my part.
>
>
>
>
> Yahoo! Groups Links
>
>
>Message
Re: [AVR-Chat] Simple casting winavr
2008-01-24 by Mike
Attachments
- No local attachments were found for this message.