+/*
+ * Copyright Droids Corporation, Microb Technology, Eirbot (2005)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Revision : $Id: main.c,v 1.4.6.3 2007-05-28 12:55:48 zer0 Exp $
+ *
+ */
+
+#include <aversive.h>
+#include <aversive/wait.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#define TX_ENABLE_PORT 2
+#define DATA_PORT 1
+#define BUZZER_PORT 0
+
+#define TX_ON() sbi(PORTB, TX_ENABLE_PORT)
+#define TX_OFF() cbi(PORTB, TX_ENABLE_PORT)
+
+#define DATA_ON() sbi(PORTB, DATA_PORT)
+#define DATA_OFF() cbi(PORTB, DATA_PORT)
+
+int main(void)
+{
+ int i;
+
+ /* PORTB TX/DATA out*/
+ DDRB |= (1 << TX_ENABLE_PORT) |
+ (1 << DATA_PORT) |
+ (1 << BUZZER_PORT);
+
+
+ while (1) {
+ PORTB &= ~(1 << TX_ENABLE_PORT);
+ wait_ms(500);
+ PORTB |= (1 << TX_ENABLE_PORT);
+ for (i=0;i<100; i++) {
+ PORTB |= (1 << DATA_PORT);
+ PORTB |= (1 << BUZZER_PORT);
+ _delay_us(1000);
+ PORTB &= ~(1 << DATA_PORT);
+ PORTB &= ~(1 << BUZZER_PORT);
+ _delay_us(1000);
+ }
+ }
+
+ return 0;
+}