also ich habe gar keine for Angabe. Hier ist die komplette datei.Villeicht kannst du mir ja weiter helfen.:
00001 /************************************************** *************************
00002 *
00003 * File Name: kollisiontest.c
00004 * Project : ASURO
00005 *
00006 * Description: Kollisionstest mit Hilfe 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,
00012 * anstelle 8x PollSwitch
00013 *
00014 * benoetigt die modifizierte Asuro Bibliothek 'asuro.c'
00015 * von waste, stochri und andun. Zu finden bei www.roboternetz.de
00016 */
00017 /************************************************** *************************
00018 * *
00019 * This program is free software; you can redistribute it and/or modify *
00020 * it under the terms of the GNU General Public License as published by *
00021 * the Free Software Foundation; either version 2 of the License, or *
00022 * any later version. *
00023 ************************************************** *************************/
00024
00025 #include "asuro.h"
00026
00027 #define FULL_L 250
00028 #define FULL_R 220
00029
00030 /* Motor vorwärts */
00031 void MotorFwd(void)
00032 {
00033 MotorDir(FWD,FWD);
00034 MotorSpeed(FULL_L,FULL_R);
00035 }
00036
00037 /* Motor rückwärts */
00038 void MotorRwd(void)
00039 {
00040 MotorDir(RWD,RWD);
00041 MotorSpeed(FULL_L,FULL_R);
00042 }
00043
00044 /* Motor rückwärts Links */
00045 void MotorRwdL(void)
00046 {
00047 MotorDir(RWD,RWD);
00048 MotorSpeed(FULL_L,0);
00049 }
00050
00051 /* Motor rückwärts Rechts */
00052 void MotorRwdR(void)
00053 {
00054 MotorDir(RWD,RWD);
00055 MotorSpeed(0, FULL_R);
00056 }
00057
00058 /* Motor stop */
00059 void MotorStop(void)
00060 {
00061 MotorSpeed(0,0);
00062 }
00063
00064 int main(void)
00065 {
00066 unsigned char t1, t2;
00067
00068 Init();
00069 while (1)
00070 {
00071 t1 = PollSwitch();
00072 t2 = PollSwitch();
00073 if (t1 == 0 && t2 == 0) /* keine Taste */
00074 {
00075 MotorFwd(); /* vorwärts fahren */
00076 FrontLED(ON);
00077 BackLED(OFF,OFF);
00078 }
00079 else if (t1 && t2 && t1 == t2)
00080 {
00081 MotorStop();
00082 if (t1 & 0x07) /* Tasten links gedrückt? */
00083 {
00084 MotorRwdL(); /* Rückwärtskurve links fahren */
00085 FrontLED(OFF);
00086 BackLED(ON,OFF);
00087 }
00088 if (t1 & 0x3 /* Tasten rechts gedrückt? */
00089 {
00090 MotorRwdR(); /* Rückwärtskurve rechts fahren */
00091 FrontLED(OFF);
00092 BackLED(OFF,ON);
00093 }
00094 Msleep(1000); /* 1 Sekunde fahren */
00095 }
00096 }
00097 return 0;
00098 }
00099