{"id":3106,"date":"2020-01-20T17:34:11","date_gmt":"2020-01-20T16:34:11","guid":{"rendered":"https:\/\/www.breizh56.fr\/crepp2024\/?page_id=3106"},"modified":"2020-02-15T08:28:34","modified_gmt":"2020-02-15T07:28:34","slug":"arduino-2019-6a","status":"publish","type":"page","link":"https:\/\/www.breizh56.fr\/crepp2024\/arduino-2019-6a\/","title":{"rendered":"Arduino 2019-6a: montage ServoMoteur avec UltraSon HC-SR04 _ Processing"},"content":{"rendered":"<h2><span style=\"color: #222222;\"><b>bricolage:<\/b><\/span><\/h2>\n<p>consignes pour monter le servomoteur avec le capteur UltraSon HC-SR04:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Montage-ServoMoteur-Ultrason_3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3105\" src=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Montage-ServoMoteur-Ultrason_3.jpg\" alt=\"\" width=\"247\" height=\"265\" \/><\/a> <a href=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Montage-ServoMoteur-Ultrason_2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3104\" src=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Montage-ServoMoteur-Ultrason_2.jpg\" alt=\"\" width=\"239\" height=\"250\" \/><\/a> <a href=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Montage-ServoMoteur-Ultrason_1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3103\" src=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Montage-ServoMoteur-Ultrason_1.jpg\" alt=\"\" width=\"211\" height=\"225\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Montage-12-servomoteur-Ultrason-SR04.mov\">Montage 1:2 servomoteur Ultrason SR04<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Montage-22-servomoteur-Ultrason-SR04.mov\">Montage 2:2 servomoteur Ultrason SR04<\/a><\/p>\n<hr \/>\n<p>programmes:\u00a0<a href=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/02\/Crepp_radar.ino_.zip\">Crepp_radar.ino<\/a><\/p>\n<p>le servomoteur va tourner lentement de gauche \u00e0 droite puis de droite \u00e0 gauche, permettant au capteur ultrason de mesurer la distance par rapport au plus proche objet.<\/p>\n<p>Le programme envoie \u00e0 la fen\u00eatre terminal le couple de donn\u00e9e <strong>degr\u00e9,distance.<\/strong><\/p>\n<p>code Arduino<\/p>\n<pre><\/pre>\n<pre>\/\/ ajout biblioth\u00e8que du servo moteur\r\n#include &lt;Servo.h&gt;. \r\n\r\n\/\/ Definition broches Trig et Echo pour ultrason\r\nconst int trigPin = 10;\r\nconst int echoPin = 11;\r\nconst float VitesseSon = 0.034; \/\/ vitesse son= 340 m\/s\r\n\r\n\/\/ Variables duree et distance\r\nlong duree;\r\nint distance;\r\n\r\n\/\/ objet servo moteur pour controler le servo\r\nServo myServo;\r\n\r\n\/*\r\n ******************************************************************************** \r\n*\/\r\nvoid setup() {\r\n  pinMode(trigPin, OUTPUT); \/\/ trigPin en Sortie \r\n  pinMode(echoPin, INPUT); \/\/ echoPin en entr\u00e9e\r\n  Serial.begin(9600);\r\n  myServo.attach(12); \/\/ pin du servo moteur\r\n}\r\n\/*\r\n ******************************************************************************** \r\n*\/\r\nvoid loop() {\r\n \/\/ rotation du servo motor de 15 \u00e0 165 degres\r\n for(int i=15;i&lt;=165;i++){ \r\n    myServo.write(i);\r\n    delay(30);\r\n    \/\/ appel fonction de calcul de la distance \r\n    \/\/ mesur\u00e9e par le capteur Ultrasonic pour chaque degr\u00e9\r\n    distance = calculateDistance();\r\n    Serial.print(i); \/\/ envoie angle en degr\u00e9 sur le port s\u00e9rie\r\n    Serial.print(\",\"); \/\/ ajout de , pour s\u00e9parer les donn\u00e9es pour Processing\r\n    Serial.print(distance); \/\/ envoie distance sur le port s\u00e9rie\r\n    Serial.print(\".\"); \/\/ ajout de . pour terminer les donn\u00e9es pour Processing\r\n }\r\n \/\/ idem pour le retour de 165 \u00e0 15 degres\r\n for(int i=165;i&gt;15;i--){ \r\n    myServo.write(i);\r\n    delay(30);\r\n    \/\/ appel fonction de calcul de la distance \r\n    \/\/ mesur\u00e9e par le capteur Ultrasonic pour chaque degr\u00e9\r\n    distance = calculateDistance();\r\n    Serial.print(i);\r\n    Serial.print(\",\");\r\n    Serial.print(distance);\r\n    Serial.print(\".\");\r\n }\r\n}\r\n\/*\r\n ******************************************************************************** \r\n*\/\r\n\/\/ Fonction de calcul de la distance mesur\u00e9e par le capteur UltraSonic\r\nint calculateDistance(){ \r\n \r\n   digitalWrite(trigPin, LOW); \r\n   delayMicroseconds(2);\r\n   \/\/ trigPin \u00e0 HIGH state pour 10 micro secondes\r\n   digitalWrite(trigPin, HIGH); \r\n   delayMicroseconds(10);\r\n   digitalWrite(trigPin, LOW);\r\n   duree = pulseIn(echoPin, HIGH); \r\n   \/\/ lit echoPin pour mesurer le parcours du son en micro secondes\r\n   \/\/ 2: mesure aller +retour\r\n   distance= duree*VitesseSon\/2;\r\n   return distance;\r\n}\r\n\r\n<\/pre>\n<p>on obtient des donn\u00e9es de type <em><strong>degr\u00e9,distance obstacle.<\/strong><\/em>\u00a0et dans le terminal on lit les r\u00e9sultats:<\/p>\n<p><a href=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/radar-terminal.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3170\" src=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/radar-terminal.jpg\" alt=\"\" width=\"1063\" height=\"157\" srcset=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/radar-terminal.jpg 1063w, https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/radar-terminal-300x44.jpg 300w, https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/radar-terminal-768x113.jpg 768w, https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/radar-terminal-1024x151.jpg 1024w\" sizes=\"(max-width: 1063px) 100vw, 1063px\" \/><\/a><\/p>\n<p>utilisons Processing pour mettre en forme ces donn\u00e9es en temps r\u00e9el sous forme d&rsquo;un graphique.<\/p>\n<hr \/>\n<h2>logiciel Processing<\/h2>\n<p>1er\u00a0pas dans la programmation cr\u00e9ative car nous utiliserons Processing pour la mise en page, en image des donn\u00e9es acquises en temps r\u00e9el sur l&rsquo;Arduino _ ici la distance mesur\u00e9e par le capteur ultra-son HC-SR04_<\/p>\n<p>&nbsp;<\/p>\n<p>Il faut installer Processing sur votre micro-ordinateur:<\/p>\n<p><a href=\"https:\/\/download.processing.org\/processing-3.5.4-windows64.zip\">Windows 64 bit<\/a>, ( <a href=\"https:\/\/download.processing.org\/processing-3.5.4-windows32.zip\">Windows 32 bit<\/a>\u00a0), <a href=\"https:\/\/download.processing.org\/processing-3.5.4-linux64.tgz\">Linux 64 bit<\/a>, <a href=\"https:\/\/download.processing.org\/processing-3.5.4-macosx.zip\">Mac OSX<\/a>,<\/p>\n<p><a href=\"https:\/\/processing.org\/reference\/\">R\u00e9f\u00e9rence des instructions Processing<\/a> \u00e0 notre disposition<\/p>\n<p>voici une pr\u00e9sentation des possibilit\u00e9s de base de Processing:<br \/>\n<iframe loading=\"lazy\" title=\"vimeo-player\" src=\"https:\/\/player.vimeo.com\/video\/140600280\" width=\"640\" height=\"360\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><br \/>\nquelques <a href=\"https:\/\/processing.org\/examples\/\">exemples ICI<\/a><\/p>\n<hr \/>\n<p>on va utliser quelques fonctions de dessin\/tra\u00e7age de Processing<\/p>\n<p>&nbsp;<\/p>\n<pre>size (400, 500); \/\/ taille affichage\r\nfill(98,245,31); \/\/ fond vert\r\nrect(0, 0, width, height-height*0.065); \/\/ un rectangle borde l'affichage pour faire joli !\r\n\r\n\/\/ arc de cercle commen\u00e7ant en x:200, y:200, largeur, hauteur, \r\n\r\n\/\/ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0angle d\u00e9but en radian, angle fin radian,\r\n\r\n\/\/ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 fa\u00e7on de terminer le dessin: CHORD\/OPEN\/TWO_PI\/<strong>PIE<\/strong> _<em>tarte!<\/em>_ )\r\narc(200, 200, 300, 300, 0, PI+QUARTER_PI, PIE);<\/pre>\n<p><a href=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing_arc.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3142\" src=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing_arc.jpg\" alt=\"\" width=\"400\" height=\"521\" srcset=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing_arc.jpg 400w, https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing_arc-230x300.jpg 230w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/a><a href=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing-arc.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3153\" src=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing-arc-230x300.jpg\" alt=\"\" width=\"230\" height=\"300\" srcset=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing-arc-230x300.jpg 230w, https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing-arc.jpg 401w\" sizes=\"(max-width: 230px) 100vw, 230px\" \/><\/a><\/p>\n<pre>couleur: R\/Rouge, G\/Vert, B\/Bleu\r\n\r\nfill(0,0,255); \u00a0\/\/ bleu\r\n\r\nfill(50); \u00a0 \/\/ noir<\/pre>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing-text.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3147\" src=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing-text-229x300.jpg\" alt=\"\" width=\"229\" height=\"300\" srcset=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing-text-229x300.jpg 229w, https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing-text.jpg 400w\" sizes=\"(max-width: 229px) 100vw, 229px\" \/><\/a><\/p>\n<p class=\"margin\"><a href=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing-line-rect-translate.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3150\" src=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing-line-rect-translate-300x186.jpg\" alt=\"\" width=\"300\" height=\"186\" srcset=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing-line-rect-translate-300x186.jpg 300w, https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/01\/Processing-line-rect-translate.jpg 399w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>programme:\u00a0<a href=\"https:\/\/www.breizh56.fr\/crepp2024\/wp-content\/uploads\/2020\/02\/Crepp_radar.pde_.zip\">Crepp_radar.pde<\/a><\/p>\n<pre>import processing.serial.*; \/\/ imports library for serial communication\r\nimport java.awt.event.KeyEvent; \/\/ imports library for reading the data from the serial port\r\nimport java.io.IOException;\r\n\r\n\/\/ *\r\n\/\/ nouvel objet port s\u00e9rie ...\r\n\/\/ o\u00f9 arrive le flux de donn\u00e9es Arduino\r\nSerial myPort; \r\n\r\n\/\/ *\r\n\/\/ d\u00e9finition des variables\r\nString angle=\"\";\r\nString distance=\"\";\r\nString data=\"\";\r\nString noObject;\r\nfloat pixsDistance;\r\nint iAngle, iDistance;\r\nint index1=0;\r\nint index2=0;\r\nint RadarLimite=40; \/\/ on se limite \u00e0 scanner 40 cm\r\nPFont orcFont;\r\n\r\n\/\/ rappel couleur RGB\r\n\/\/ http:\/\/www.proftnj.com\/RGB3.htm\r\n\/\/ stroke(r,g,b) et fill(r,g,b) \r\n\/\/ (255,10,10)red color, stroke(0,0,255) red blue\r\n\/\/ (255, 255,0); red yellow, (154,205,50); red yellow green, (98,245,31); vert\r\n\/\/ (98,245,31); vert, (30,250,60); vert sombre, (98,245,31); vert vif\r\n\/\/ (0,4,0); noir, \r\n\r\n\r\n\/\/ *\r\n\/\/ ***********************************\r\nvoid setup() {\r\n \/\/ *\r\n \/\/ r\u00e9solution \u00e9cran\r\n size (1200, 700);\r\n smooth();\r\n \/\/myPort = new Serial(this,\"COM5\", 9600); \/\/ starts the serial communication\r\n myPort = new Serial(this,\"\/dev\/cu.usbmodemFA131\", 9600); \/\/ starts the serial communication\r\n myPort.bufferUntil('.'); \/\/ reads the data from the serial port up to the character '.'. So actually it reads this: angle,distance.\r\n}\r\n\r\n\/\/*\r\n\/\/ ***********************************\r\nvoid draw() {\r\n fill(98,245,31); \/\/ vert \r\n \/\/ simulating motion blur and slow fade of the moving line\r\n noStroke();\r\n fill(0,4); \/\/ noir\r\n rect(0, 0, width, height-height*0.065); \r\n \r\n fill(98,245,31); \/\/ green color\r\n \/\/ appels des focntions pour dessiner le radar\r\n drawRadar(); \r\n drawLine();\r\n drawObject();\r\n drawText();\r\n}\r\n\r\n\/\/ *\r\n\/\/ ***********************************\r\nvoid serialEvent (Serial myPort) { \r\n \/\/ d\u00e9but de lecture des donn\u00e9es du port S\u00e9rie \r\n \/\/ d\u00e9coupage des donn\u00e9es issues du port S\u00e9rie: \r\n \/\/ au caract\u00e8re de fin de donn\u00e9es \".\" on place les donn\u00e9es dans la variable \"data\"\r\n data = myPort.readStringUntil('.');\r\n data = data.substring(0,data.length()-1);\r\n \r\n \/\/ trouve le caract\u00e8re \",\" et on place les dans la variable \"index1\"\r\n index1 = data.indexOf(\",\"); \r\n \r\n \/\/ ainsi la variable \"angle\" est la partie de \"data\" \r\n \/\/ du 1er caract\u00e8re de \"data\" au \"index\" i\u00e8me carat\u00e8re\r\n angle= data.substring(0, index1);\r\n \r\n \/\/ ainsi la variable \"distance\" est la partie de \"data\" \r\n \/\/ du \"index+1\" i\u00e8me carat\u00e8re \u00e0 la fin _= data.length() _\r\n distance= data.substring(index1+1, data.length()); \r\n \r\n \/\/ conversion des variables en entier pour la suite des calculs\r\n iAngle = int(angle);\r\n iDistance = int(distance);\r\n}\r\n\r\n\/\/ *\r\n\/\/ ***********************************\r\nvoid drawRadar() {\r\n pushMatrix();\r\n \/\/ nouvelle origine des coordon\u00e9es \r\n translate(width\/2,height-height*0.074); \r\n noFill();\r\n strokeWeight(2);\r\n stroke(98,245,31); \/\/ vert\r\n \r\n \/\/ dessine des lignes des arcs de cercle\r\n arc(0,0,(width-width*0.0625),(width-width*0.0625),PI,TWO_PI);\r\n arc(0,0,(width-width*0.27),(width-width*0.27),PI,TWO_PI);\r\n arc(0,0,(width-width*0.479),(width-width*0.479),PI,TWO_PI);\r\n arc(0,0,(width-width*0.687),(width-width*0.687),PI,TWO_PI);\r\n \r\n \/\/ dessine les lignes des angles\r\n line(-width\/2,0,width\/2,0);\r\n line(0,0,(-width\/2)*cos(radians(30)),(-width\/2)*sin(radians(30)));\r\n line(0,0,(-width\/2)*cos(radians(60)),(-width\/2)*sin(radians(60)));\r\n line(0,0,(-width\/2)*cos(radians(90)),(-width\/2)*sin(radians(90)));\r\n line(0,0,(-width\/2)*cos(radians(120)),(-width\/2)*sin(radians(120)));\r\n line(0,0,(-width\/2)*cos(radians(150)),(-width\/2)*sin(radians(150)));\r\n line((-width\/2)*cos(radians(30)),0,width\/2,0);\r\n popMatrix();\r\n}\r\n\r\n\/\/ *\r\n\/\/ *****************\r\nvoid drawObject() {\r\n pushMatrix();\r\n \/\/ nouvelle origine des coordon\u00e9es \r\n translate(width\/2,height-height*0.074); \r\n strokeWeight(9);\r\n stroke(255,10,10); \/\/ rouge\r\n stroke(#0055FF);   \/\/ bleu\r\n \/\/ calcule la distance de cm en pixels\r\n pixsDistance = iDistance*((height-height*0.1666)*0.025);\r\n \r\n \/\/ port\u00e9e limite \u00e0 distance 40 cm\r\n if(iDistance&lt;RadarLimite){\r\n \/\/ dessine en focntion de l'angle et de la diastance\r\n line(pixsDistance*cos(radians(iAngle)),-pixsDistance*sin(radians(iAngle)),(width-width*0.505)*cos(radians(iAngle)),-(width-width*0.505)*sin(radians(iAngle)));\r\n }\r\n popMatrix();\r\n}\r\n\r\n\/\/ *\r\n\/\/ ***********************\r\n\r\n\/\/ *\r\n\/\/ *****************\r\nvoid drawObject_old() {\r\n pushMatrix();\r\n \/\/ nouvelle origine des coordon\u00e9es \r\n translate(width\/2,height-height*0.074); \r\n strokeWeight(9);\r\n stroke(255,10,10); \/\/ rouge\r\n \r\n \/\/ calcule la distance de cm en pixels\r\n pixsDistance = iDistance*((height-height*0.1666)*0.025);\r\n \r\n \/\/ port\u00e9e limite \u00e0 distance 40 cm\r\n if(iDistance&lt;RadarLimite){\r\n \/\/ dessine en focntion de l'angle et de la distance\r\n line(pixsDistance*cos(radians(iAngle)),-pixsDistance*sin(radians(iAngle)),(width-width*0.505)*cos(radians(iAngle)),-(width-width*0.505)*sin(radians(iAngle)));\r\n }\r\n popMatrix();\r\n}\r\n\r\n\/\/ *\r\n\/\/ *************************\r\nvoid drawLine() {\r\n pushMatrix();\r\n strokeWeight(9);\r\n stroke(30,250,60); \/\/ vert sombre\r\n \/\/ origine des coordonn\u00e9es d\u00e9call\u00e9es\r\n translate(width\/2,height-height*0.074); \r\n \/\/ dessine en focntion de l'angle\r\n line(0,0,(height-height*0.12)*cos(radians(iAngle)),-(height-height*0.12)*sin(radians(iAngle))); \r\n popMatrix();\r\n}\r\n\r\n\/\/ *\r\n\/\/ ***********************************\r\nvoid drawText() { \r\n \/\/ affiche le texte \u00e0 l'\u00e9cran\r\n \r\n pushMatrix();\r\n if(iDistance&gt;40) {\r\n noObject = \"hors port\u00e9e\";\r\n }\r\n else {\r\n noObject = \"radar en focntion\";\r\n }\r\n fill(0,0,0);\r\n noStroke();\r\n rect(0, height-height*0.0648, width, height);\r\n fill(98,245,31); \/\/ vert vif\r\n textSize(25);\r\n \r\n text(\"10cm\",width-width*0.3854,height-height*0.0833);\r\n text(\"20cm\",width-width*0.281,height-height*0.0833);\r\n text(\"30cm\",width-width*0.177,height-height*0.0833);\r\n text(\"40cm\",width-width*0.0729,height-height*0.0833);\r\n textSize(40);\r\n text(\" CREPP 2020\", width-width*0.9, height-height*0.0277);\r\n text(\"Angle: \" + iAngle +\" \u00b0\", width-width*0.6, height-height*0.0277);\r\n text(\"Distance: \", width-width*0.3, height-height*0.0277);\r\n if(iDistance&lt;40) {\r\n text(\" \" + iDistance +\" cm\", width-width*0.225, height-height*0.0277);\r\n }\r\n textSize(25);\r\n fill(98,245,60); \/\/ vert\r\n translate((width-width*0.4994)+width\/2*cos(radians(30)),(height-height*0.0907)-width\/2*sin(radians(30)));\r\n rotate(-radians(-60));\r\n text(\"30\u00b0\",0,0);\r\n resetMatrix();\r\n translate((width-width*0.503)+width\/2*cos(radians(60)),(height-height*0.0888)-width\/2*sin(radians(60)));\r\n rotate(-radians(-30));\r\n text(\"60\u00b0\",0,0);\r\n resetMatrix();\r\n translate((width-width*0.507)+width\/2*cos(radians(90)),(height-height*0.0833)-width\/2*sin(radians(90)));\r\n rotate(radians(0));\r\n text(\"90\u00b0\",0,0);\r\n resetMatrix();\r\n translate(width-width*0.513+width\/2*cos(radians(120)),(height-height*0.07129)-width\/2*sin(radians(120)));\r\n rotate(radians(-30));\r\n text(\"120\u00b0\",0,0);\r\n resetMatrix();\r\n translate((width-width*0.5104)+width\/2*cos(radians(150)),(height-height*0.0574)-width\/2*sin(radians(150)));\r\n rotate(radians(-60));\r\n text(\"150\u00b0\",0,0);\r\n popMatrix(); \r\n}\r\n\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>bricolage: consignes pour monter le servomoteur avec le capteur UltraSon HC-SR04: &nbsp; Montage 1:2 servomoteur Ultrason SR04 &nbsp; Montage 2:2 servomoteur Ultrason SR04 programmes:\u00a0Crepp_radar.ino le servomoteur va tourner lentement de gauche \u00e0 droite puis de droite \u00e0 gauche, permettant au capteur ultrason de mesurer la distance par rapport au plus proche objet. Le programme envoie \u00e0 la fen\u00eatre terminal le [&#8230;]<\/p>\n","protected":false},"author":7,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3106","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.breizh56.fr\/crepp2024\/wp-json\/wp\/v2\/pages\/3106"}],"collection":[{"href":"https:\/\/www.breizh56.fr\/crepp2024\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.breizh56.fr\/crepp2024\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.breizh56.fr\/crepp2024\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.breizh56.fr\/crepp2024\/wp-json\/wp\/v2\/comments?post=3106"}],"version-history":[{"count":37,"href":"https:\/\/www.breizh56.fr\/crepp2024\/wp-json\/wp\/v2\/pages\/3106\/revisions"}],"predecessor-version":[{"id":3182,"href":"https:\/\/www.breizh56.fr\/crepp2024\/wp-json\/wp\/v2\/pages\/3106\/revisions\/3182"}],"wp:attachment":[{"href":"https:\/\/www.breizh56.fr\/crepp2024\/wp-json\/wp\/v2\/media?parent=3106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}