-
        

Seite 1 von 2 12 LetzteLetzte
Ergebnis 1 bis 10 von 15

Thema: Probleme mit der ASURO lib v2.6.1

  1. #1

    Probleme mit der ASURO lib v2.6.1

    Anzeige

    SMARTPHONES & TABLETS-bis zu 77% RABATT-Kostenlose Lieferung-Aktuell | Cool | Unentbehrlich
    Hallo Ihr Asuro-kundigen dort draußen...

    Ich habe mir gerade von http://sourceforge.net/project/showf...ease_id=465255 mal die aktuelle Libary für den Asuro runter geladen, weil ich mal die IR - Abstandserkennung testen wollte. Nun tritt nur leider beim make folgender fehler auf

    -------- begin --------
    avr-gcc --version
    avr-gcc (GCC) 3.3.1
    Copyright (C) 2003 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    avr-gcc -c -mmcu=atmega8 -I. -g -Os -I../../lib/inc -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
    asuro.c:184: warning: return type defaults to `int'
    asuro.c:184: warning: function declaration isn't a prototype
    asuro.c: In function `SIGNAL':
    asuro.c:188: warning: control reaches end of non-void function
    asuro.c: At top level:
    asuro.c:195: warning: return type defaults to `int'
    asuro.c:195: warning: function declaration isn't a prototype
    asuro.c:195: error: redefinition of `SIGNAL'
    asuro.c:184: error: `SIGNAL' previously defined here
    asuro.c:212: warning: return type defaults to `int'
    asuro.c:212: warning: function declaration isn't a prototype
    asuro.c:212: error: redefinition of `SIGNAL'
    asuro.c:195: error: `SIGNAL' previously defined here
    make: *** [asuro.o] Error 1

    > Process Exit Code: 2
    Ich hoffe das mir einer von euch weiterhelfen kann. Im Forum und Web habe ich leider nichts dazu gefunden habe, was mir weiter geholfen hätte...

    gruß, köpi

  2. #2
    Erfahrener Benutzer Roboter Experte
    Registriert seit
    01.11.2006
    Beiträge
    433
    hast du vergessen die asuro.h zu inkludieren?

  3. #3
    Hallo EDH,
    ich habe die Demo Files genommen die bei der Libary dabei sind um Fehler meinerseits so weit wie möglich auszuschließen... hier aber auchnochmal der Code vom Testprogramm.

    Code:
    /*******************************************************************************
    *
    * Description: Asuro IR-Detektor Testprogramm
    *
    *****************************************************************************/
    //#include <avr/signal.h>
    #include "asuro.h"
    #include <stdlib.h>
    
    
    int main(void)
    {
    
       unsigned char sw;
       
       Init();
       DDRD |= (1 << DDD1);	// Port D1 als Ausgang
       PORTD &= ~(1 << PD1);	// PD1 auf LOW
       
       while(1)
       {
    	if (PIND & (1 << PD0))
    		StatusLED(GREEN);
    	else
    		StatusLED(RED);
    		
    	sw = PollSwitch();
    	if (sw & 0x01)
    		OCR2  = 0xFE;	//Pulsbreite 1
    	if (sw & 0x02)
    		OCR2  = 0xFD;	//Pulsbreite 2
    	if (sw & 0x04)
    		OCR2  = 0xFB;	//Pulsbreite 4
    	if (sw & 0x08)
    		OCR2  = 0xF7;	//Pulsbreite 8
    	if (sw & 0x10)
    		OCR2  = 0xEF;	//Pulsbreite 16
    	if (sw & 0x20)
    		OCR2  = 0x90;	//Pulsbreite 110
       }
       return 0;
    }
    Irgendwo im Internet habe ich gefunden, dass man die <avr/signal.h> noch einbinden sollte aber das hat auch nicht geholfen...

  4. #4
    Erfahrener Benutzer Roboter Experte
    Registriert seit
    01.11.2006
    Beiträge
    433
    jetzt hab ich die demo files grad selber mal kompiliert. es kalppt wunderbar.
    (nur bei der SelfTest demo gings nicht. aber da hat irgendjemand test.h statt Test.h geschrieben)

    es könnte sein, das die path variable bei dir nicht korrekt ist.

  5. #5
    Erfahrener Benutzer Roboter Genie Avatar von m.a.r.v.i.n
    Registriert seit
    24.07.2005
    Ort
    Berlin
    Beiträge
    1.247
    Hallo köpi,

    die Asuro Lib Version 2.6.1 ist für die aktuelle WinAVR Version 20060421 angepaßt.
    Für die alte WinAVR Version von der Asuro CD mußt du folgende Zeile in die Asuro.h einfügen.

    #include <avr/signal.h>
    Besser ist es aber die aktuelle WinAVR zu installieren.
    http://sourceforge.net/project/showf...group_id=68108

    Gruß m.ar.v.i.n

  6. #6
    Hallo m.a.r.v.i.n,

    DANKE! Hatte die neue Version schon runtergeladen. Nur auf die idee sie auch zu installieren bin ich irgendwie net gekommen ^^

    Gruß, köpi

  7. #7
    Neuer Benutzer Öfters hier
    Registriert seit
    06.09.2006
    Beiträge
    22
    Also wegen der Funktion PrintInt habe ich auch die neue Version asuro.c von der Lib heruntergeladen, wenn ich jdoch den toll make ausführe kommt das


    C:\Dokumente und Einstellungen\Eli\Desktop\Asuro\ASURO_src\FirstTry >make all
    -------- begin --------
    avr-gcc --version
    avr-gcc (GCC) 3.3.1
    Copyright (C) 2003 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    Size before:
    test.elf :
    section size addr
    .text 1512 0
    .data 0 8388704
    .bss 1 8388704
    .noinit 0 8388705
    .eeprom 0 8454144
    .stab 3120 0
    .stabstr 1744 0
    Total 6377


    avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
    In file included from test.c:2:
    asuro.c: In function `__vector_2':
    asuro.c:196: error: `switched' undeclared (first use in this function)
    asuro.c:196: error: (Each undeclared identifier is reported only once
    asuro.c:196: error: for each function it appears in.)
    asuro.c: In function `__vector_14':
    asuro.c:220: error: `encoder' undeclared (first use in this function)
    asuro.c: In function `Encoder_Init':
    asuro.c:463: warning: implicit declaration of function `Encoder_Set'
    asuro.c: At top level:
    asuro.c:470: warning: type mismatch with previous implicit declaration
    asuro.c:463: warning: previous implicit declaration of `Encoder_Set'
    asuro.c:470: warning: `Encoder_Set' was previously implicitly declared to return `int'
    asuro.c: In function `Encoder_Set':
    asuro.c:471: error: `encoder' undeclared (first use in this function)
    asuro.c:471: error: `LEFT' undeclared (first use in this function)
    asuro.c:472: error: `RIGHT' undeclared (first use in this function)
    asuro.c: In function `PrintInt':
    asuro.c:489: warning: implicit declaration of function `itoa'
    asuro.c: In function `Go':
    asuro.c:519: warning: implicit declaration of function `abs'
    asuro.c:531: error: `encoder' undeclared (first use in this function)
    asuro.c:531: error: `LEFT' undeclared (first use in this function)
    asuro.c:532: error: `RIGHT' undeclared (first use in this function)
    asuro.c: In function `Turn':
    asuro.c:580: error: `encoder' undeclared (first use in this function)
    asuro.c:580: error: `LEFT' undeclared (first use in this function)
    asuro.c:581: error: `RIGHT' undeclared (first use in this function)
    make: *** [test.o] Error 1

    > Process Exit Code: 2


    was soll ich jetzt mache´n oder was habe ich evtl falsch gemacht

    Also hab aber asuro h inkludiert

  8. #8
    Erfahrener Benutzer Roboter Experte
    Registriert seit
    01.11.2006
    Beiträge
    433
    das sieht irgendwie so aus, als ob die asuro.h bei dir nicht korrekt wäre.
    überprüf das mal.
    ist die vieleicht noch die alte standard version?

  9. #9
    Neuer Benutzer Öfters hier
    Registriert seit
    06.09.2006
    Beiträge
    22
    Also ich ahb die version von 2005
    Code:
    #include "asuro.h"
    #include "string.h"
    
    /*! \brief Counter fuer 36kHz.\n
     *  Wird in derInterrupt Funktion SIG_OVERFLOW2 hochgezaehlt\n
     *  und in der Sleep() Funktion abgefragt.
     *  \see Sleep
     */
    volatile unsigned char count36kHz;	
    /*! \brief Sytemzeit.\n
     *  Wird in der Interrupt Funktion SIG_OVERFLOW2 hochgezaehlt\n
     *  und in der Gettime() Funktion verwendet.
     *  \see Gettime
     */
    volatile unsigned long timebase;
    /*! \brief Odometrie Sensor Abfrage im Interrupt Betrieb.\n
     *  Wird in der Interrupt Funktion SIG_ADC abgefragt,\n
     *  in der Encoder_Init() und Encoder_Start() Funktion gesetzt\n
     *  und in der Encoder_Stop() Funktion geloescht .
     *  \see Encoder_Init, Encoder_Start, Encoder_Stop
     */
    volatile int autoencode=FALSE;
    
    /*! 
     * \func SIG_OVERFLOW2 
     * \brief Interrupt Funktion: Timer2 Overflow 
     * uses timer2 (36kHz for IR communication) 
     */
    SIGNAL (SIG_OVERFLOW2)
    {
    	TCNT2 += 0x25;
    	count36kHz ++;
    	if (!count36kHz) timebase ++;
    }
    
    /*!
     * \func SIG_INTERRUPT1 
     * \brief Interrupt Funktion: INT1  
     */
    SIGNAL (SIG_INTERRUPT1)
    {
    	switched=1;
    	StopSwitch();
    }
    
    /*!
     * \func SIG_ADC 
     * \brief Interrupt Funktion: A/D Wandler
     *	last modification:
     * 	Ver.     Date         Author           Comments
     * 	-------  ----------   --------------   ---------------------------------
     * 	2.61     20.11.2006   m.a.r.v.i.n      static Variable toggle initialisiert
     * 	                                       auf False (Bug report von Rolf_Ebert) 
     * 
     * 
     */
    SIGNAL (SIG_ADC)
    {
    	static unsigned char tmp[2],flag[2],toggle=FALSE;
    	if (autoencode){
    	tmp[toggle]= ADCH;
    	if (toggle)	ADMUX = (1 <<ADLAR) | (1 <<REFS0) | WHEEL_RIGHT; 
    	else ADMUX = (1 <<ADLAR) | (1 <<REFS0) | WHEEL_LEFT; 
    
    	if ( (tmp[toggle] < 140) && (flag[toggle] == TRUE)) {
    		encoder[toggle] ++;
    		flag[toggle] = FALSE;
    	}
    	if ( (tmp[toggle] > 160) && (flag[toggle] == FALSE)) {
    		encoder[toggle] ++;
    		flag[toggle] = TRUE; 
    	}
    	toggle ^= 1; 
    }}
    // neue Zeitfunktion
    unsigned long Gettime(void)
    {
    	return ((timebase*256)+count36kHz)/36;
    }
    
    /* Init function Processor will be initalized to work correctly */
    void Init (void)
    {
    	//-------- seriell interface programmed in boot routine and already running -------
    	//  prepare 36kHz for IR - Communication
    	TCCR2 = (1 << WGM20) | (1 << WGM21) | (1 << COM20) | (1 << COM21) | (1 << CS20);
    	OCR2  = 0x91; // duty cycle for 36kHz
    	TIMSK |= (1 << TOIE2); // 36kHz counter for sleep
    	
    	// prepare RS232 
    	UCSRA = 0x00;
    	UCSRB = 0x00;	
    	UCSRC = 0x86; // No Parity | 1 Stop Bit | 8 Data Bit
    	UBRRL = 0xCF; // 2400bps @ 8.00MHz
    	
    	// I/O Ports
    	DDRB = IRTX | LEFT_DIR | PWM | GREEN_LED; 
    	DDRD = RIGHT_DIR | FRONT_LED | ODOMETRIE_LED | RED_LED;
    	
    	// for PWM (8-Bit PWM) on OC1A & OC1B
    	TCCR1A = (1 << WGM10) | (1 << COM1A1) | (1 << COM1B1);
    	// tmr1 running on MCU clock/8 
    	TCCR1B = (1 << CS11);
    	
    	// A/D Conversion
    	ADCSRA = (1 << ADEN) | (1 << ADPS2) | (1 << ADPS1); // clk/64 
    	ODOMETRIE_LED_OFF;
    
    	FrontLED(OFF);
    	BackLED(ON,ON);
    	BackLED(OFF,OFF);
    	StatusLED(GREEN);
    	
    	MotorDir(FWD,FWD);
    	MotorSpeed(0,0);
    	sei();
    }
    
    /* Set motor speed */
    inline void MotorSpeed(unsigned char left_speed, unsigned char right_speed)
    {
    	OCR1A = left_speed;
    	OCR1B = right_speed;
    }
    
    /* Set motor direction */
    inline void MotorDir(unsigned char left_dir, unsigned char right_dir)
    {
    	PORTD = (PORTD &~ ((1 << PD4) | (1 << PD5))) | left_dir;
    	PORTB = (PORTB &~ ((1 << PB4) | (1 << PB5))) | right_dir;
    }
    
    /* Status LED (OFF,GREEN,YELLOW,RED)*/
    /* example code set StatusLED GREEN */
    /* StatusLED(GREEN); */
    inline void StatusLED(unsigned char color)
    {
    	if (color == OFF)    {GREEN_LED_OFF; RED_LED_OFF;}
    	if (color == GREEN)  {GREEN_LED_ON; RED_LED_OFF;} 
    	if (color == YELLOW) {GREEN_LED_ON; RED_LED_ON;}
    	if (color == RED)    {GREEN_LED_OFF; RED_LED_ON;}
    }
    
    /* Front LED */
    /* example code FrontLED ON */
    /* FrontLED(ON); */
    inline void FrontLED(unsigned char status)
    {
    	PORTD = (PORTD &~(1 << PD6)) | (status << PD6);
    }
    
    /* function for Break LEDs */
    /* example code right LED On left LED Off */
    /* BackLED(OFF,ON); */
    void BackLED(unsigned char left, unsigned char right)
    {
    	if (left || right) {
    		PORTD &= ~(1 << PD7); // Wheel LED OFF
    		DDRC |= (1 << PC0) | (1 << PC1); // Output => no odometrie
    		PORTC |= (1 << PC0) | (1 << PC1);
    	}
    	if (!left) PORTC &= ~(1 << PC1);
    	if (!right) PORTC &= ~(1 << PC0);
    }
    int  Batterie(void)
    {
    	ADMUX = (1 << REFS0) | (1 << REFS1) | BATTERIE;	// internal 2.56V reference with external capacitor
    	ADCSRA |= (1 << ADSC);			// Start conversion
    	while (!(ADCSRA & (1 << ADIF)));	// wait for conversion complete
    	ADCSRA |= (1 << ADIF);			// clear ADCIF
    	return ADCL + (ADCH << 8);
    }
    /* function to read out line follow phototransistors (left,rigth) */
    void LineData(unsigned int *data)
    {	
    	int ec_bak=autoencode;
    	autoencode=FALSE;
    
    	ADMUX = (1 << REFS0) | IR_LEFT;	// AVCC reference with external capacitor
    	Sleep(10);
    	ADCSRA |= (1 << ADSC);			// Start conversion
    	while (!(ADCSRA & (1 << ADIF)));	// wait for conversion complete
    	ADCSRA |= (1 << ADIF);			// clear ADCIF
    	data[0] = ADCL + (ADCH << 8);
    	
    	ADMUX = (1 << REFS0) | IR_RIGHT;	// AVCC reference with external capacitor
    	Sleep(10);
    	ADCSRA |= (1 << ADSC);			// Start conversion
    	while (!(ADCSRA & (1 << ADIF)));	// wait for conversion complete
    	ADCSRA |= (1 << ADIF);			// clear ADCIF
    	data[1] = ADCL + (ADCH << 8);
    	
    	autoencode=ec_bak;
    }
    
    /* function to read out odometrie phototransistors (left,rigth) */
    void OdometrieData(unsigned int *data)
    {
    	DDRC &= ~((1 << PC0) | (1 << PC1)); // Input => no break LED
    	ODOMETRIE_LED_ON;
    	
    	ADMUX = (1 << REFS0) | WHEEL_LEFT; // AVCC reference with external capacitor
    	ADCSRA |= (1 << ADSC);			// Start conversion
    	while (!(ADCSRA & (1 << ADIF)));	// wait for conversion complete
    	ADCSRA |= (1 << ADIF);			// clear ADCIF
    	data[0] = ADCL + (ADCH << 8);
    	
    	ADMUX = (1 << REFS0) | WHEEL_RIGHT; // AVCC reference with external capacitor
    	ADCSRA |= (1 << ADSC);			// Start conversion
    	while (!(ADCSRA & (1 << ADIF)));	// wait for conversion complete
    	ADCSRA |= (1 << ADIF);			// clear ADCIF
    	data[1] = ADCL + (ADCH << 8);
    }
    
    /* function for serial communication */
    void SerWrite(unsigned char *data,unsigned char length)
    {
    	unsigned char i = 0;
    	UCSRB = 0x08; // enable transmitter
    	while (length > 0) {
    		if (UCSRA & 0x20) { // wait for empty transmit buffer
    			UDR = data[i++];
    			length --;
    		}
    	}
    	while (!(UCSRA & 0x40)); 
    	for (i = 0; i < 0xFE; i++)
    		for(length = 0; length < 0xFE; length++); 
    }
    
    void SerRead(unsigned char *data, unsigned char length,unsigned int timeout)
    {
    	unsigned char i = 0;
    	unsigned int  time = 0;
    	UCSRB = 0x10; // enable receiver
    	/* non blocking */
    	if (timeout != 0) {
    		while (i < length && time++ < timeout) {
    			if (UCSRA & 0x80) {
    				data[i++] = UDR;
    				time = 0;
    			}
    		}
    		if (time > timeout) data[0] = 'T';
    	}
    	/* blocking */
    	else {
    		while (i < length) {
    			if (UCSRA & 0x80) 
    				data[i++] = UDR;
    		}
    	}	
    }
    
    /* function to read out switches */
    unsigned char PollSwitch (void)
    {
    	unsigned int i;
    	int ec_bak=autoencode;
    	autoencode=FALSE;
    	DDRD |= SWITCHES;				// Switches as Output
    	SWITCH_ON;						// Output HIGH for measurement
    	ADMUX = (1 << REFS0) | SWITCH;	// AVCC reference with external capacitor
    	Sleep(10);
    	
    	ADCSRA |= (1 << ADSC);			// Start conversion
    	while (!(ADCSRA & (1 << ADIF)));// wait for conversion complete
    	ADCSRA |= (1 << ADIF);			// clear ADCIF
    	i = ADCL + (ADCH << 8);
    	
    	SWITCH_OFF;
    	Sleep(5);
    	autoencode=ec_bak;
    	//return  ((unsigned char) ((( 1024.0/(float)i - 1.0)) * 61.0 + 0.5));
    	return ((10240000L/(long)i-10000L)*61L+5000L)/10000;
    }
    
    /* for working with Interrupt */
    void StartSwitch(void)
    {
    	SWITCH_OFF;
    	DDRD &= ~SWITCHES;					// Switches as Input => ext. Int 1
    	MCUCR &= ~((1 << ISC11) | (1 << ISC10));// Low level generates interrupt
    	GICR |= (1 << INT1);					// Enable external Interrupt 1 
    }
    
    void StopSwitch(void)
    {
    	GICR &= ~(1 << INT1);
    }
    
    /* uses 36kHz timer => Sleep(x) = x/36kHz [sec] */
    void Sleep(unsigned char time36kHz)
    {   
    	unsigned char ziel=(time36kHz+count36kHz) & 0x00FF;
    	while (count36kHz != ziel);
    }
    
    
    void Encoder_Init(void)
    {
    	cli();
    	DDRC &= ~ ((1<<PC0) | (1<<PC1)); // Input => no break LED
    	ODOMETRIE_LED_ON;
    	ADCSRA = (1<<ADEN) | (1<<ADFR) | (1<<ADIE) | (1<<ADSC) | (1<<ADPS0) | (1<<ADPS1) | (1<<ADPS2); // clk/128
    	ADMUX = (1<<ADLAR) | (1<<REFS0) | WHEEL_LEFT; // AVCC reference with external capacitor
    	autoencode=TRUE;
    	sei();
    	Encoder_Set(0,0);
    }
    
    void Encoder_Stop(void){autoencode=FALSE;}
    void Encoder_Start(void){autoencode=TRUE;}
    
    void Encoder_Set(int setl,int setr)
    {
    	encoder[LEFT]=setl;
    	encoder[RIGHT]=setr;
    }
    
    /***************************************************************************
    *	void PrintInt(int wert)                                                                         
    *	
    *	last modification:
    * 	Ver.     Date         Author           Comments
    * 	-------  ----------   --------------   ---------------------------------
    * 	2.60     28.09.2005   m.a.r.v.i.n      strlen instead fixed length
    * 	2.61     20.11.2006   m.a.r.v.i.n      Initialisierung text String kann zu Fehler 
    *                                              beim Flashen mit RS232/IR Adapter fuehren
    *                                              (Bug report von francesco)  
    ***************************************************************************/
    void PrintInt(int wert)
    {  	
    	char text[6];
    	itoa(wert,text,10);
    	SerWrite(text,strlen(text));
    }
    
    void Msleep(int dauer)
    {
    	int z;
    	for(z=0;z<dauer;z++) Sleep(36);
    }
    /***************************************************************************
    *	void Go(int distance, int speed = 150)                                                                         
    *	
    *   input
    *	distance: postiv->go forward ; negativ-> go backward
    *   speed: sets motorspeed
    *
    *	last modification:
    * 	Ver.     Date         Author           Comments
    * 	-------  ----------   --------------   ---------------------------------
    * 	sto1     29.07.2005   stochri	       motorfunction
    *	And1	 31.07.2005   Andun            added speed and Odometrie
    * 	-------  ----------   --------------   ---------------------------------
    *
    ***************************************************************************/
    void Go(int distance, int speed)
    {
    	int enc_count = 0;
    	int tot_count = 0;
    	int diff = 0;
    	int l_speed = speed, r_speed = speed;
    	enc_count=abs(distance);
    	
    //	enc_count=distance*10000;
    //	enc_count/=12823;
    	
    	Encoder_Set(0,0);		// reset encoder
    
    	MotorSpeed(l_speed,r_speed);
    	if(distance<0) MotorDir(RWD,RWD);
    	else MotorDir(FWD,FWD);
    
    	while(tot_count<enc_count) {
    		tot_count += encoder[LEFT];
    		diff = encoder[LEFT] - encoder[RIGHT];
    		if (diff > 0) { //Left faster than right
    			if ((l_speed > speed) || (r_speed > 244)) l_speed -= 10;
    			else r_speed += 10;
    		}
    		if (diff < 0) { //Right faster than left
    			if ((r_speed > speed) || (l_speed > 244)) r_speed -= 10;
    			else l_speed += 10;
    		}
    	Encoder_Set(0,0);		// reset encoder
    	MotorSpeed(l_speed,r_speed);
    	Msleep(1);
    	}
    	MotorDir(BREAK,BREAK);
    	Msleep(200);
    }
    /***************************************************************************
    *	void Turn(int degree, int speed)
    *	
    *   input
    *	degree: postiv->turn right ; negativ-> turn left
    *
    *	last modification:
    * 	Ver.     Date         Author           Comments
    * 	-------  ----------   --------------   ---------------------------------
    * 	sto1     29.07.2005   stochri          motorfunction
    *	And1	 07.08.2005   Andun            Added Odometrie function
    * 	-------  ----------   --------------   ---------------------------------
    *
    ***************************************************************************/
    void Turn(int degree, int speed)
    {
    	long enc_count;
    	enc_count=abs(degree)*0166L; 
    	enc_count /= 0360L;
    	
    	int tot_count = 0;
    	int diff = 0;
    	int l_speed = speed, r_speed = speed;
    		
    	
    	Encoder_Set(0,0);		// reset encoder
    
    	MotorSpeed(l_speed,r_speed);
    	if(degree<0) MotorDir(RWD,FWD);
    	else MotorDir(FWD,RWD);
    
    	while(tot_count<enc_count) {
    		tot_count += encoder[LEFT];
    		diff = encoder[LEFT] - encoder[RIGHT];
    		if (diff > 0) { //Left faster than right
    			if ((l_speed > speed) || (r_speed > 244)) l_speed -= 10;
    			else r_speed += 10;
    		}
    		if (diff < 0) { //Right faster than left
    			if ((r_speed > speed) || (l_speed > 244)) r_speed -= 10;
    			else l_speed += 10;
    		}
    	Encoder_Set(0,0);		// reset encoder
    	MotorSpeed(l_speed,r_speed);
    	Msleep(1);
    	}
    	MotorDir(BREAK,BREAK);
    	Msleep(200);
    }
    Hab nur asuro.h und asuro.c esetzt muss ich noch was anderes ersetzten oder hinzufügen vielleicht

  10. #10
    Erfahrener Benutzer Roboter Experte
    Registriert seit
    01.11.2006
    Beiträge
    433
    das oebn ist die asruo.c
    ist die asuro.h bei dir richtig?
    poste die mal.

Seite 1 von 2 12 LetzteLetzte

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •