hab jetzt mal probiert ein anderes programmm zu compilieren geht auch net..
kommt immer dieser error
vor her ging es ja noch
Druckbare Version
hab jetzt mal probiert ein anderes programmm zu compilieren geht auch net..
kommt immer dieser error
vor her ging es ja noch
Code:/*******************************************************************************
*
* File Name: RechteckDemo.c
* Project : Demo
*
* Description: This file contains RechteckDemo
*
* Ver. Date Author Comments
* ------- ---------- -------------- ------------------------------
* 1.00 14.08.2003 Jan Grewe build
* 2.00 22.10.2003 Jan Grewe angepasst auf asuro.c Ver.2.10
*
* Copyright (c) 2003 DLR Robotics & Mechatronics
*****************************************************************************/
/***************************************************************************
* *
* 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 *
* any later version. *
***************************************************************************/
#include "asuro.h"
#define LEFT 0
#define RIGHT 1
#define LINE 0
#define EDGE 1
SIGNAL (SIG_ADC)
{
static unsigned char tmp[2],flag[2],toggle;
static unsigned char state = LINE, posFlag[2] = {FALSE,FALSE};
static unsigned char pos[2] = {0,0};
static unsigned char rightSpeed = 200, leftSpeed = 200;
tmp[toggle]= ADCH;
if (toggle) ADMUX = (1 <<ADLAR) | (1 <<REFS0) | WHEEL_RIGHT;
else ADMUX = (1 <<ADLAR) | (1 <<REFS0) | WHEEL_LEFT;
if ( (tmp[toggle] < 128) && (flag[toggle] == TRUE)) {
pos[toggle] ++;
flag[toggle] = FALSE;
}
if ( (tmp[toggle] > 128) && (flag[toggle] == FALSE)) {
pos[toggle] ++;
flag[toggle] = TRUE;
}
toggle ^= 1;
if (state == LINE) {
if (pos[LEFT] > 100) {
leftSpeed = 0;
pos[LEFT] = 0;
posFlag[LEFT] = TRUE;
}
if (pos[RIGHT] > 100) {
rightSpeed = 0;
pos[RIGHT] = 0;
posFlag[RIGHT] = TRUE;
}
if (posFlag[RIGHT] == TRUE && posFlag[LEFT] == TRUE) {
state = EDGE;
leftSpeed = 180;
}
}
if (state == EDGE) {
if (pos[LEFT] > 50) {
leftSpeed = 0;
pos[LEFT] = 0;
posFlag[LEFT] = posFlag[RIGHT] = FALSE;
state = LINE;
leftSpeed = rightSpeed = 200;
}
}
MotorSpeed(leftSpeed,rightSpeed);
}
void RechteckDemo(void)
{
Init();
cli();
MotorSpeed(200,200);
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
sei();
for(;;);
}
das ist ja auch kein vollständiges programm....
vielleicht solltest du, anstatt fragmente aus dem netz zu laden, mal selbst ein kleines testprogramm schreiben?
Ich hab noch keine Ahung von C....
Dieses Programm habe ich von der CD.
Wo kann ich ein vollständiges Programm runterladen ?
Das kommt daher, dass die main-Funktion in Deinem Programm fehlt. Jedes C-Programm muss aber eine haben. Mach mal aus 'void RechteckDemo(void)' ein 'int main()', dann sollte es klappen.Zitat:
C:\WinAVR\bin\..\lib\gcc-lib\avr\3.3.1\..\..\..\..\avr\lib\avr4\crtm8.o(.in it9+0x0): undefined reference to `main'
MfG Mark
habs gemacht .... trotzdem dieser FehlerZitat:
Zitat von p_mork
hast du gespeichert vor dem kompilieren?
lies mal in der anleitung nach wie man programme schreibt, und fang an selbst etwas zu entwickeln.
ach danke .. ich hatte nicht gespeichert ^^ jetzt geht alles