Go Down

Topic: Problème avec les fonctions Servo, Softservo et Servo 8 bit sur ATtiny85. (Read 4602 times) previous topic - next topic

croustipizza49

Bonjour,

Personne n'a d'idées pour mon problème?

Est ce que ca pourrait venir du type de l'ATtiny85 (ici des 20 PU) ?

Quel type alors pour commander des servos?

Merci pour votre aide.

cirilg

Bonjour,

je suis dans le meme cas, rien de fonctionne, je ne peux pas compiler le code sans avoir une erreur avec servo8bit.
voila mon code

#include "Servo8Bit.h"
 
int main()
{
    Servo8Bit myServo;  //create a servo object.
                        //a maximum of five servo objects can be created
 
    myServo.attach(1);  //attach the servo to pin PB1
 
    //sweep the servo
    while(1)
    {
        for(int pos = 0; pos < 180; pos++)  // goes from 0 degrees to 180 degrees
        {                                   // in steps of 1 degree
            myServo.write(pos);             // tell servo to go to position in variable 'pos'
            delay(15);                      // waits 15ms for the servo to reach the position
        }
 
        for(int pos = 180; pos > 1; pos--)  // goes from 180 degrees to 0 degrees
        {
            myServo.write(pos);             // tell servo to go to position in variable 'pos'
            delay(15);                      // waits 15ms for the servo to reach the position
        }
    }
}

et les messages d'erreurs
Arduino : 1.6.11 (Windows 7), Carte : "ATtiny85 @ 16 MHz  (internal PLL; 4.3 V BOD)"

Warning: Board tiny:avr:attiny24at16 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY24AT16
Warning: Board tiny:avr:attiny2313at1 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY2313AT1
Warning: Board tiny:avr:attiny44at1 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY44AT1
Warning: Board tiny:avr:attiny25at8 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY25AT8
Warning: Board tiny:avr:attiny85at16p doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY85AT16P
Warning: Board tiny:avr:attiny84at8 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY84AT8
Warning: Board tiny:avr:attiny4313at1 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY4313AT1
Warning: Board tiny:avr:attiny45at8 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY45AT8
Warning: Board tiny:avr:attiny84at1 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY84AT1
Warning: Board tiny:avr:attiny85at128 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY85AT128
Warning: Board tiny:avr:attiny85at1 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY85AT1
Warning: Board tiny:avr:attiny85at16e doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY85AT16E
Warning: Board tiny:avr:attiny2313at8 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY2313AT8
Warning: Board tiny:avr:attiny45at1 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY45AT1
Warning: Board tiny:avr:attiny44at8 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY44AT8
Warning: Board tiny:avr:attiny25at1 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY25AT1
Warning: Board tiny:avr:attiny84at16 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY84AT16
Warning: Board tiny:avr:attiny4313at8 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY4313AT8
Warning: Board tiny:avr:attiny85at8 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY85AT8
Les options de compilation ont été modifiées, tout sera recompilé
Attention: platform.txt du cœur 'Arduino Tiny' contiens tools.avrdude.cmd.path={runtime.ide.path}/hardware/tools/avr/bin/avrdude dépassé, converti automatiquement en tools.avrdude.cmd.path={path}/bin/avrdude. La mise a niveau de ce cœur est conseillée.
Attention: platform.txt du cœur 'Arduino Tiny' contiens tools.avrdude.config.path={runtime.ide.path}/hardware/tools/avr/etc/avrdude.conf dépassé, converti automatiquement en tools.avrdude.config.path={path}/etc/avrdude.conf. La mise a niveau de ce cœur est conseillée.
Attention: platform.txt du cœur 'Arduino Tiny' contiens recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} "{build.path}/{archive_file}" "{object_file}" dépassé, converti automatiquement en recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} "{archive_file_path}" "{object_file}". La mise a niveau de ce cœur est conseillée.
Attention: platform.txt du cœur 'Arduino Tiny' contiens recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm dépassé, converti automatiquement en recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} -o "{build.path}/{build.project_name}.elf" {object_files} "{archive_file_path}" "-L{build.path}" -lm. La mise a niveau de ce cœur est conseillée.
libraries\Servo8Bit-master\example.cpp.o: In function `main':

C:\Program Files (x86)\Arduino\libraries\Servo8Bit-master/example.cpp:14: multiple definition of `main'

sketch\SerialServo.pde.cpp.o:C:\Users\tweedy\AppData\Local\Temp\arduino_modified_sketch_439548/SerialServo.pde:4: first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1
Erreur de compilation pour la carte ATtiny85 @ 16 MHz  (internal PLL; 4.3 V BOD)
Bibliothèque non valide trouvée dans C:\Program Files (x86)\Arduino\libraries\arduino-nrf24l01-master : C:\Program Files (x86)\Arduino\libraries\arduino-nrf24l01-master
Bibliothèque non valide trouvée dans C:\Program Files (x86)\Arduino\libraries\arduino-nrf24l01-master : C:\Program Files (x86)\Arduino\libraries\arduino-nrf24l01-master

merci d'avance



Go Up