TasterTest/test.c

gehe zur Dokumentation dieser Datei
00001 /***********************************************************************
00002  *
00003  * File Name:   tastsensor.c
00004  * Project  :   ASURO
00005  *
00006  * Description: Test der Tastensensoren
00007  *
00008  * Ver.     Date         Author           Comments
00009  * -------  ----------   --------------   ------------------------------
00010  * 1.0      10.09.2005   m.a.r.v.i.n      initial build
00011  * 1.1      08.01.2006   m.a.r.v.i.n      2x PollSwitch + Vergleich, anstelle 8x PollSwitch
00012  *
00013  */
00014 /***************************************************************************
00015  *                                                                         *
00016  *   This program is free software; you can redistribute it and/or modify  *
00017  *   it under the terms of the GNU General Public License as published by  *
00018  *   the Free Software Foundation; either version 2 of the License, or     *
00019  *   any later version.                                                    *
00020  ***************************************************************************/
00021 
00022 #include <stdlib.h>
00023 #include "asuro.h"
00024 
00025 int main(void)
00026 {
00027   uint8_t t1, t2;
00028   unsigned char text[16];
00029 
00030   Init();
00031   SerPrint("\r\nTastsensor Test\r\n");
00032   while (1)
00033   {
00034     t1 = PollSwitch();
00035     t2 = PollSwitch();
00036     if (t1 && t2 && t1 == t2)              /* irgendeine Taste gedrueckt */
00037     {
00038       itoa(t1, text, 10);     /* Tastenwert senden */
00039       SerPrint(text);
00040       SerPrint("\r\n"); /* Zeilenvorschub */
00041     }
00042     Msleep(500);
00043   }
00044 }

Erzeugt am Mon Apr 9 13:28:39 2007 für ASURO Library von  doxygen 1.5.1-p1