Bonjour à tous,
Je faisais tourner un programme qui collectait les données envoyées par un ir sharp monté sur un servo et les affichait sur un shield LCD.J'ai juste voulu changé la valeur de delay() et là, le téléversement est devenu impossible.La jauge de téléchargement s'arrête avant la fin et le message suivant apparait:
avrdude:stk500_getsync() :not in sync:resp=0X00
pendant le téléversement les 2 diodes rx et tx ne clignotent pas ,les 2 autres sont allumées.
Bien sûr j'ai essayé de charger d'autres programmes avec juste la carte arduino (sans montage).Résultat idem
J'ai vérifié le port com et fait des reset.nada
Cela ressemble un peu au pb ou quelqu'un a du changer sa carte parce qu'il avait utilisé les ports tx et rx(je n'ai pas retrouvé le topic ),mais ce n'est pas mon cas.
Je mets le programme qui a causé l'erreur et je vous remercie de m'avoir consacré de votre temps
<pre>
#include<span style="color: #006699;">"Wire.h"</span>
#include<<span style="color: #CC6600;">Deuligne</span>.h>
#include <<span style="color: #CC6600;">Servo</span>.h>
<span style="color: #CC6600;">const</span> <span style="color: #CC6600;">int</span> RVar=1;
<span style="color: #CC6600;">int</span> mesureBrute=0;
<span style="color: #CC6600;">float</span> tension=0;
<span style="color: #CC6600;">Deuligne</span> lcd;
<span style="color: #CC6600;">Servo</span> myservo; <span style="color: #7E7E7E;">// create servo object to control a servo </span>
<span style="color: #7E7E7E;">// a maximum of eight servo objects can be created </span>
<span style="color: #CC6600;">int</span> pos = 0; <span style="color: #7E7E7E;">// variable to store the servo position </span>
<span style="color: #CC6600;">void</span> <span style="color: #CC6600;"><b>setup</b></span>()
{
myservo.<span style="color: #CC6600;">attach</span>(2); <span style="color: #7E7E7E;">// attaches the servo on pin 2 to the servo object </span>
lcd.init();
}
<span style="color: #CC6600;">void</span> <span style="color: #CC6600;"><b>loop</b></span>()
{
lcd.<span style="color: #CC6600;">setCursor</span>(0,1);lcd.<span style="color: #CC6600;">print</span>(<span style="color: #006699;">"DEGRES BITS"</span>);
<span style="color: #CC6600;">for</span>(pos = 0; pos < 180; pos += 1) <span style="color: #7E7E7E;">// goes from 0 degrees to 180 degrees </span>
{ <span style="color: #7E7E7E;">// in steps of 1 degree </span>
myservo.<span style="color: #CC6600;">write</span>(pos); <span style="color: #7E7E7E;">// tell servo to go to position in variable 'pos'</span>
lcd.<span style="color: #CC6600;">setCursor</span>(0,0);
lcd.<span style="color: #CC6600;">print</span>(pos);
mesureBrute=<span style="color: #CC6600;">analogRead</span>(RVar);
lcd.<span style="color: #CC6600;">setCursor</span>(7,0); lcd.<span style="color: #CC6600;">print</span>(mesureBrute);
<span style="color: #CC6600;">delay</span>(5); <span style="color: #7E7E7E;">// waits 15ms for the servo to reach the position </span>
lcd.<span style="color: #CC6600;">print</span>(<span style="color: #006699;">" "</span>);
}
<span style="color: #CC6600;">for</span>(pos = 180; pos>=1; pos-=1) <span style="color: #7E7E7E;">// goes from 180 degrees to 0 degrees </span>
{
myservo.<span style="color: #CC6600;">write</span>(pos); <span style="color: #7E7E7E;">// tell servo to go to position in variable 'pos' </span>
lcd.<span style="color: #CC6600;">setCursor</span>(0,0);
lcd.<span style="color: #CC6600;">print</span>(pos);
mesureBrute=<span style="color: #CC6600;">analogRead</span>(RVar);
lcd.<span style="color: #CC6600;">setCursor</span>(7,0); lcd.<span style="color: #CC6600;">print</span>(mesureBrute);
<span style="color: #CC6600;">delay</span>(5); <span style="color: #7E7E7E;">// waits 15ms for the servo to reach the position </span>
lcd.<span style="color: #CC6600;">print</span>(<span style="color: #006699;">" "</span>);
}
}
</pre>