- 3D-Druck Einstieg und Tipps         
Seite 2 von 3 ErsteErste 123 LetzteLetzte
Ergebnis 11 bis 20 von 25

Thema: Erstes eigenes Programm

  1. #11
    Erfahrener Benutzer Begeisterter Techniker Avatar von Ferdinand
    Registriert seit
    10.09.2004
    Ort
    Stuttgart
    Alter
    43
    Beiträge
    230
    Anzeige

    LiFePo4 Akku selber bauen - Video
    ok

    Ich habe den path zu AsuroLib geendert und jetst kommt das

    Code:
    >Ready.
    >Session Environment Variables:
    AF_AVRDIR=C:\WinAVR-20080610
    AF_PROJECT=Project1
    AF_SOURCE_FILES=test1.c
    AF_ASM_SRC_FILES=
    AF_PRGDIR=C:\Programme\AsuroFlash
    AF_PRJDIR=C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\AsuroFlash
    AF_LIB_PATH=C:\AsuroFlash\AsuroLib-v280rc1\lib
    File test1.c saved.
    >Default make_all.cmd file created.
    >Default makefile created.
    Make
    C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\AsuroFlash>C:\WinAVR-20080610\utils\bin\make all 
    set -e; avr-gcc -MM -mmcu=atmega8 -DF_CPU=8000000UL -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test1.lst -IC:\Programme\AsuroFlash\include -IC:\AsuroFlash\AsuroLib-v280rc1\lib\inc test1.c \
    	| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test1.d; \
    	[ -s test1.d ] || rm -f test1.d
    -------- begin --------
    avr-gcc --version
    avr-gcc (WinAVR 20080610) 4.3.0
    Copyright (C) 2008 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 -DF_CPU=8000000UL -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test1.lst -IC:\Programme\AsuroFlash\include -IC:\AsuroFlash\AsuroLib-v280rc1\lib\inc test1.c -o test1.o
    avr-gcc -mmcu=atmega8 -DF_CPU=8000000UL -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test1.o -IC:\Programme\AsuroFlash\include -IC:\AsuroFlash\AsuroLib-v280rc1\lib\inc test1.o  --output Project1.elf -Wl,-Map=Project1.map,--cref -IC:\Programme\AsuroFlash\lib -LC:\AsuroFlash\AsuroLib-v280rc1\lib -lm -lasuro
    test1.o: In function `main':
    C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\AsuroFlash/test1.c:5: undefined reference to `Init'
    make: *** [Project1.elf] Error 1
    
    
    ExitCode 2
    was muss ich jetst machen ?

    thx
    habe schreiben erst heute gelernt.

    bin legasteniger.

    by Ferdinand.

  2. #12
    Erfahrener Benutzer Begeisterter Techniker Avatar von Ferdinand
    Registriert seit
    10.09.2004
    Ort
    Stuttgart
    Alter
    43
    Beiträge
    230
    ich bekomme kein *.hex



    Code:
    #include "asuro.h"
    
    init();
    
    int main(void){
    
        unsigned int data[2];
    
    //init();                                          
    
    
      FrontLED(ON);
      
      MotorDir(FWD,FWD);
      
      
       while (1)
       
      {
    	
     LineData(data);
     
       if (data[0] > data[1])
       
        {
    	
       MotorSpeed(200,150);
       
              }
    		  
      else
      
       {
       
      MotorSpeed(150,200) ;
      
            }
    		
    		
    							}
    							
       return 0;
    }
    Code:
    > "C:\ASURO_src\FirstTry\Test-all.bat" 
    
    C:\ASURO_src\FirstTry>make all 
    set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
    | sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
    [ -s asuro.d ] || rm -f asuro.d
    set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
    | sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
    [ -s test.d ] || rm -f test.d
    -------- 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 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
    test.c:5: warning: type defaults to `int' in declaration of `init'
    test.c:5: warning: function declaration isn't a prototype
    test.c:5: warning: data definition has no type or storage class
    test.c:45:2: warning: no newline at end of file
    avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
    avr-gcc -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.o test.o asuro.o   --output test.elf -Wl,-Map=test.map,--cref -lm
    avr-objcopy -O ihex -R .eeprom test.elf test.hex
    avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
    --change-section-lma .eeprom=0 -O ihex test.elf test.eep
    avr-objdump -h -S test.elf > test.lss
    Size after:
    test.elf  :
    section    size      addr
    .text      1552         0
    .data         0   8388704
    .bss          1   8388704
    .noinit       0   8388705
    .eeprom       0   8454144
    .stab      3204         0
    .stabstr   1763         0
    Total      6520
    
    
    Errors: none
    -------- end --------
    
    > Process Exit Code: 0
    > Time Taken: 00:00
    thx
    habe schreiben erst heute gelernt.

    bin legasteniger.

    by Ferdinand.

  3. #13
    Moderator Robotik Visionär Avatar von radbruch
    Registriert seit
    27.12.2006
    Ort
    Stuttgart
    Alter
    61
    Beiträge
    5.799
    Blog-Einträge
    8
    Hallo

    Warum schreibst du das Init() außerhalb von main()? Das wird natürlich angemotzt:
    test.c:5: warning: type defaults to `int' in declaration of `init'
    test.c:5: warning: function declaration isn't a prototype
    test.c:5: warning: data definition has no type or storage class
    test.c:45:2: warning: no newline at end of file
    ...und nach dem letzten } fehlt angeblich noch ein [Enter]

    Warum kein .hex erzeugt wird weiß ich auch nicht. Vielleicht mal ein "clean all" ausführen...

    Gruß

    mic
    Bild hier  
    Atmel’s products are not intended, authorized, or warranted for use
    as components in applications intended to support or sustain life!

  4. #14
    Erfahrener Benutzer Begeisterter Techniker Avatar von Ferdinand
    Registriert seit
    10.09.2004
    Ort
    Stuttgart
    Alter
    43
    Beiträge
    230
    hi

    das kommt dabei raus
    Code:
    #include "asuro.h"
    
    
    int main(void){
    
        unsigned int data[2];
    
    init();                                          
    
    
      FrontLED(ON);
      
      MotorDir(FWD,FWD);
      
      
       while (1)
       
      {
    	
     LineData(data);
     
       if (data[0] > data[1])
       
        {
    	
       MotorSpeed(200,150);
       
              }
    		  
      else
      
       {
       
      MotorSpeed(150,200) ;
      
            }
    		
    		
    							}
    							
       return 0;
    }
    Code:
    > "C:\ASURO_src\FirstTry\Test-all.bat" 
    
    C:\ASURO_src\FirstTry>make all 
    set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
    | sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
    [ -s asuro.d ] || rm -f asuro.d
    set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
    | sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
    [ -s test.d ] || rm -f test.d
    -------- 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 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
    test.c: In function `main':
    test.c:10: warning: implicit declaration of function `init'
    avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
    avr-gcc -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.o test.o asuro.o   --output test.elf -Wl,-Map=test.map,--cref -lm
    test.o(.text+0x8): In function `main':
    C:\ASURO_src\FirstTry/test.c:10: undefined reference to `init'
    make: *** [test.elf] Error 1
    
    > Process Exit Code: 2
    > Time Taken: 00:01
    THX
    habe schreiben erst heute gelernt.

    bin legasteniger.

    by Ferdinand.

  5. #15
    Moderator Robotik Visionär Avatar von radbruch
    Registriert seit
    27.12.2006
    Ort
    Stuttgart
    Alter
    61
    Beiträge
    5.799
    Blog-Einträge
    8
    C:\ASURO_src\FirstTry/test.c:10: undefined reference to `init'
    Die Funktion heißt Init() mit großem I am Anfang. Wir sind nahe dran :)
    Bild hier  
    Atmel’s products are not intended, authorized, or warranted for use
    as components in applications intended to support or sustain life!

  6. #16
    Erfahrener Benutzer Begeisterter Techniker Avatar von Ferdinand
    Registriert seit
    10.09.2004
    Ort
    Stuttgart
    Alter
    43
    Beiträge
    230
    OK

    Ich hab jetzt alles neu gemacht mit den sahen von der Arexx HP und jetzt geht es.

    Du hast recht mit großem I

    Danke!!!


    wo find ich den ein besseres Beispiel für die "PollSwitch" tastern.


    Mit freundlichen Grüßen Ferdinand.
    habe schreiben erst heute gelernt.

    bin legasteniger.

    by Ferdinand.

  7. #17
    Benutzer Stammmitglied
    Registriert seit
    11.04.2007
    Ort
    Hildesheim
    Alter
    36
    Beiträge
    41
    Hallo
    Ich habe auch mal wieder den Asuro rausgekramt und habe mal versucht ein programm zu schreiben und zwar dieses hier:
    Code:
    #include "asuro.h"
    
    int main(void)
    {	
    	unsigned char Speed;
    	unsigned int i;
    	
    	
    	Init();	
    	StatusLED (GREEN);
    	MotorDir(FWD,FWD);
    	MotorSpeed(255,255);
    	while (PollSwitch()==0) {
    			StatusLED (GREEN);
    	}
    	MotorSpeed(0,0);
    	for (i=0; i<200; i++) {
    	Sleep(255);}
    	MotorDir(RWD,RWD);
    	MotorSpeed(150,150);
    	for (i=0; i<200; i++) {
    	Sleep(255);}
    	MotorDir(RWD,FWD);
    	MotorSpeed(150,150);
    	for (i=0; i<200; i++);{
    	Sleep(255); }
    	
    	
    	while(1);
    	return 0;
    }
    Aber irgendwie zeigt er die fehlermeldung an
    Code:
    set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
    | sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
    [ -s asuro.d ] || rm -f asuro.d
    set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
    | sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
    [ -s test.d ] || rm -f test.d
    -------- 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 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
    test.c: In function `main':
    test.c:5: warning: unused variable `Speed'
    avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
    avr-gcc -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.o test.o asuro.o   --output test.elf -Wl,-Map=test.map,--cref -lm
    avr-objcopy -O ihex -R .eeprom test.elf test.hex
    avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
    --change-section-lma .eeprom=0 -O ihex test.elf test.eep
    C:\Users\FELIXK~1\AppData\Local\Temp\make27964.sh: /c/WinAVR/bin/avr-objcopy: Invalid argument
    make: [test.eep] Error 126 (ignored)
    avr-objdump -h -S test.elf > test.lss
    C:\Users\FELIXK~1\AppData\Local\Temp\make27965.sh: /c/WinAVR/bin/avr-objdump: Invalid argument
    make: *** [test.lss] Error 126
    
    > Process Exit Code: 2
    Vielleicht kan mir jemand weiterhelfen! Es muss ja irgendwas mit dem unsigned char Speed zu tun haben.
    Wäre nett wenn mit jemand helfen könnte.
    Vielen Dank im Vorraus
    Felix

  8. #18
    Erfahrener Benutzer Begeisterter Techniker Avatar von Ferdinand
    Registriert seit
    10.09.2004
    Ort
    Stuttgart
    Alter
    43
    Beiträge
    230
    Deine Speed Variable wirt nicht gebraucht

    komentire das mal aus " unsigned char Speed; " so.: //unsigned char Speed;

    by Ferdinand
    habe schreiben erst heute gelernt.

    bin legasteniger.

    by Ferdinand.

  9. #19
    Erfahrener Benutzer Roboter-Spezialist
    Registriert seit
    02.01.2008
    Alter
    32
    Beiträge
    239
    hallo
    das mit der nicht benutzten variable dürfte kein problem sein, da es nur eine warnung ist (ein hinweis an den programmierer, da er vl. etwas übersehen haben könnte)
    im weiteren verlauf der fehlermeldung treten aber auch noch 2 Error126. ich glaube man sollte herausfinden was es mit diesen auf sich hat. ich kann aber auch nichts genaueres dazu sagen
    mfg hai1991

    P.S.: wer großbuchstaben oder rechtschreibfehler findet darf sie behalten

  10. #20
    Benutzer Stammmitglied
    Registriert seit
    11.04.2007
    Ort
    Hildesheim
    Alter
    36
    Beiträge
    41
    Also ich habe das Unsigned char Speed jetzt weggelassen und trotzdem kommt immer noch folgende Fehlermeldungen:
    Code:
    C:\ASURO_src\FirstTry>make all 
    set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
    | sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
    [ -s asuro.d ] || rm -f asuro.d
    set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
    | sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
    [ -s test.d ] || rm -f test.d
    -------- 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 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
    avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
    avr-gcc -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.o test.o asuro.o   --output test.elf -Wl,-Map=test.map,--cref -lm
    avr-objcopy -O ihex -R .eeprom test.elf test.hex
    avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
    --change-section-lma .eeprom=0 -O ihex test.elf test.eep
    C:\Users\FELIXK~1\AppData\Local\Temp\make33804.sh: /c/WinAVR/bin/avr-objcopy: Invalid argument
    make: [test.eep] Error 126 (ignored)
    avr-objdump -h -S test.elf > test.lss
    C:\Users\FELIXK~1\AppData\Local\Temp\make33805.sh: /c/WinAVR/bin/avr-objdump: Invalid argument
    make: *** [test.lss] Error 126
    
    > Process Exit Code: 2
    Veilleicht hat doch noch jemand eine idee? wäre schön
    Vielen dank im Vorraus und an die Leute welche mir schon geholfenhaben!
    Felix

Seite 2 von 3 ErsteErste 123 LetzteLetzte

Berechtigungen

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

LiFePO4 Speicher Test