2 * Copyright Droids Corporation, Microb Technology, Eirbot (2005)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Revision : $Id: main.c,v 1.15.10.5 2008-12-27 16:29:08 zer0 Exp $
22 #include <aversive/wait.h>
27 #include <avr/pgmspace.h>
30 * This code sends a counter value to uart.
36 /* initialize uart with the default parameters ( see
40 /* enable interrupts */
43 /* send some single characters */
44 for (i=0; i<10; i++) {
46 uart_send(0, '0' + i);
51 /* now we want to do a printf : we must register the
52 * uart0_send as stdout. Here no receive function is
54 fdevopen(uart0_dev_send, NULL);
56 /** ready to do a nice printf on the uart */
57 printf("Uart is cool !!\n");
59 /* one drawback of the previous printf is that the format
60 * chain is srored in RAM and this can take a huge size if
61 * there are many printf. To avoid this problem, please use
62 * printf_P together with PSTR, like in the next example. */
64 printf_P(PSTR("This format string takes no RAM "