{"id":10835,"date":"2025-09-22T01:18:00","date_gmt":"2025-09-22T00:18:00","guid":{"rendered":"https:\/\/dronesonen.usn.no\/?p=10835"},"modified":"2025-09-22T01:18:00","modified_gmt":"2025-09-22T00:18:00","slug":"pickmebot-week-4","status":"publish","type":"post","link":"https:\/\/dronesonen.usn.no\/?p=10835","title":{"rendered":"PickMeBot-week 4"},"content":{"rendered":"\n<p>This week, our group has started preparing the presentation for the project. We discussed the key points we want to include, such as the problem domain, our project structure, and the technical solutions we have developed. Each member has taken responsibility for different sections, and we have begun drafting slides and organizing the flow so the presentation clearly explains both our process and results.<\/p>\n\n\n\n<p>When discussing how to control the wheels, sensors and the arm of the robot we ran into the problem of having enough connections. Since the motors with built in encoders have 2 more connections each, the driver expansion board v2 has enough pins for the wheels and sensors but not for controlling the arm. so we want to use two microbits. one for controlling the wheels and sensors and one for the robotic arm. These will communicate over bluetooth.<\/p>\n\n\n\n<p><strong>Theo:<\/strong><\/p>\n\n\n\n<p>On my way to understanding how to interact with the sensor. I follow different steps. But first I had to set up an auspicious environment to speak with the micro:bit with platformio and VS code.<\/p>\n\n\n\n<p>platformio.ini : [env:bbcmicrobit_v2]<\/p>\n\n\n\n<div class=\"wp-block-group has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-fd29303f1877922ee7f1d8770a78ba37 is-layout-constrained wp-container-core-group-is-layout-fce03063 wp-block-group-is-layout-constrained\" style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0\">\n<p class=\"has-background-color has-text-color has-link-color wp-elements-fb0f7dc86c55c8ee197edc3a4a7495a3\">platform = nordicnrf52<\/p>\n\n\n\n<p>board = bbcmicrobit_v2<\/p>\n\n\n\n<p>framework = arduino<\/p>\n\n\n\n<p>upload_protocol = cmsis-dap<\/p>\n\n\n\n<p>lib_deps =<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;adafruit\/Adafruit PWM Servo Driver Library@^3.0.2<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;adafruit\/Adafruit BusIO@^1.17.2<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;adafruit\/Adafruit Microbit Library@^1.3.4<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;adafruit\/Adafruit GFX Library@^1.10.13<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;Adafruit Microbit<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/SpulberGeorge\/EasyUltrasonic.git\">https:\/\/github.com\/SpulberGeorge\/EasyUltrasonic.git<\/a><\/p>\n\n\n\n<p>lib_ldf_mode = deep+<\/p>\n<\/div>\n\n\n\n<p>My first step was to be sure that I can communicate well with micro:bit by printing a smiley on the led. Then add a sad face that changes when we click the A button. So later I can use this 2 face to know how far somethings is from the sensor.<\/p>\n\n\n\n<p>First code :&nbsp;<\/p>\n\n\n\n<p>#include &lt;Arduino.h&gt;<\/p>\n\n\n\n<p>#include &lt;Adafruit_Microbit.h&gt;<\/p>\n\n\n\n<p>Adafruit_Microbit microbit;<\/p>\n\n\n\n<p>const uint8_t PROGMEM happy_bmp[] = {<\/p>\n\n\n\n<p>&nbsp;&nbsp;B00000,<\/p>\n\n\n\n<p>&nbsp;&nbsp;B01010,<\/p>\n\n\n\n<p>&nbsp;&nbsp;B00000,<\/p>\n\n\n\n<p>&nbsp;&nbsp;B10001,<\/p>\n\n\n\n<p>&nbsp;&nbsp;B01110<\/p>\n\n\n\n<p>};<\/p>\n\n\n\n<p>const uint8_t PROGMEM sad_bmp[] = {<\/p>\n\n\n\n<p>&nbsp;&nbsp;B00000,<\/p>\n\n\n\n<p>&nbsp;&nbsp;B01010,<\/p>\n\n\n\n<p>&nbsp;&nbsp;B00000,<\/p>\n\n\n\n<p>&nbsp;&nbsp;B01110,<\/p>\n\n\n\n<p>&nbsp;&nbsp;B10001<\/p>\n\n\n\n<p>};<\/p>\n\n\n\n<p>const int BUTTON_A_PIN = 5;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p>bool isHappy = true;<\/p>\n\n\n\n<p>unsigned long lastToggleMs = 0;<\/p>\n\n\n\n<p>const unsigned long debounceMs = 250;<\/p>\n\n\n\n<p>void setup() {<\/p>\n\n\n\n<p>&nbsp;&nbsp;microbit.begin();<\/p>\n\n\n\n<p>&nbsp;&nbsp;microbit.matrix.begin();<\/p>\n\n\n\n<p>&nbsp;&nbsp;pinMode(BUTTON_A_PIN, INPUT_PULLUP); &nbsp; \/\/ pin avec pull-up (LOW = appuy\u00e9)<\/p>\n\n\n\n<p>&nbsp;&nbsp;microbit.matrix.show(happy_bmp);&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>void loop() {<\/p>\n\n\n\n<p>&nbsp;&nbsp;int state = digitalRead(BUTTON_A_PIN);<\/p>\n\n\n\n<p>&nbsp;&nbsp;if (state == LOW &amp;&amp; (millis() &#8211; lastToggleMs) &gt; debounceMs) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;\/\/ appui d\u00e9tect\u00e9 -&gt; toggle<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;isHappy = !isHappy;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;microbit.matrix.show(isHappy ? happy_bmp : sad_bmp);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;lastToggleMs = millis();<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;delay(10); \/\/ petit d\u00e9lai pour all\u00e9ger la boucle<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>Then I test with some electronics, with a basic assembly and a code to try changing the face depending on the distance from the sensor.&nbsp;<\/p>\n\n\n\n<p>Seconde code :&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-bec889197d19179ade8d409efce41061\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">#include &lt;Arduino.h&gt;<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-6499a6d974eec821f3ac9e45791b7944\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">#include &lt;Adafruit_Microbit.h&gt;<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-6d65fe3a9229f93bc2a620e9be5fca92\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">#include &lt;EasyUltrasonic.h&gt;<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-e9e2583517f0c0c535666edb8283ec80\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">Adafruit_Microbit microbit;<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-98cc907dcb3f1196663db8b37aba5498\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">const uint8_t PROGMEM happy_bmp[] = {<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-08dd12f3c536a04559a6ff9a47da528e\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;B00000,<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-9ff9288dcf6f475da8e35c99871c8c6c\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;B01010,<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-08dd12f3c536a04559a6ff9a47da528e\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;B00000,<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-971fd7a2d33728c350974c58b6779516\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;B10001,<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-20e7b0bd42c1d09d5eb62d33c6de0dc0\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;B01110<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-9e35d2d1d7063bc03f7324e741883bf0\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">};<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-6db438d21010917ea12c0dfe37865f61\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">const uint8_t PROGMEM sad_bmp[] = {<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-08dd12f3c536a04559a6ff9a47da528e\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;B00000,<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-9ff9288dcf6f475da8e35c99871c8c6c\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;B01010,<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-08dd12f3c536a04559a6ff9a47da528e\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;B00000,<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-bf9e21b48fa8362792acc9b1ff8f91e4\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;B01110,<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-e559eaebc1274a680ed692d062df5587\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;B10001<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-9e35d2d1d7063bc03f7324e741883bf0\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">};<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-d12fda7bab4f8a07a05b16b725180b50\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">#define TRIG_PIN 1&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-b47052605cd0086085a840569923f29d\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">#define ECHO_PIN 2&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-7d25e20eb9da2f4dfd6d4e822e135463\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">EasyUltrasonic ultrasonic;<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-9cacd65608cd8b89be3ce1ccc0123ebc\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">const float THRESHOLD_CM = 10.0;<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-33d123a328fa50ff15b5f44c58148cc1\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">unsigned long lastPrint = 0;<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-41b8e51b3176ed46ee77a6f5254d4693\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">void setup() {<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-370496f62c6b0b8e369c64426ff6ddfb\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;Serial.begin(115200);<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-a8cb61c9d4ff21f8dca82985935aa40f\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;microbit.begin();<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-6194e68b01d28412dd838f0c77132b09\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;microbit.matrix.begin();<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-dcb69a3408bdff656a3fba21284ca6e2\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;microbit.matrix.show(happy_bmp);<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-72f4d15af9eabe2589bc7bc9ebe985e3\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;ultrasonic.attach(TRIG_PIN, ECHO_PIN);<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-7ed25f33a3f9b1f0b10816c34ed22c31\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">}<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-37695af07bf03f06e9eea4bbad0243d6\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">void loop() {<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-afd4905b0755bfb72d6d62cdf33131b5\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;float distance = ultrasonic.getDistanceCM();<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-9c10483a37786011669dc3a1c805c73e\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;if (millis() &#8211; lastPrint &gt; 400) {<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-045c0a0729708c2e0dc80f9e58cdcff5\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;&nbsp;&nbsp;Serial.print(&#8220;Distance (cm): &#8220;);<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-ba92d0c71799c3d94c31952850291423\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;&nbsp;&nbsp;Serial.println(distance);<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-af98881a441662498db96129462362f1\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;&nbsp;&nbsp;lastPrint = millis();<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-4e03ccbc8879cfdffb2b8f7fe3bd051f\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;}<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-e1d3903d23803dbc03ba063d2a7f7b8b\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;if (distance &gt; 0 &amp;&amp; distance &lt; THRESHOLD_CM) {<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-337931ade79594dc6c03a0bd33a83cbe\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;&nbsp;&nbsp;microbit.matrix.show(sad_bmp);&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-53776c03f25dac63372481261f708734\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;} else if (distance &gt; 0) {<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-bb533c16337057a3b9a173ea987f57cf\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;&nbsp;&nbsp;microbit.matrix.show(happy_bmp);<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-4c9fa772f0df0707ff8a55a884ad418f\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;} else {<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-4e03ccbc8879cfdffb2b8f7fe3bd051f\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;}<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background has-link-color wp-elements-f0fdc2c3a1b2322fbb771fa4c1440a3d\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;line-height:1.5\">&nbsp;&nbsp;delay(150);<\/p>\n<\/div>\n\n\n\n<p>}<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dronesonen.usn.no\/8aeb0243-8535-4f2c-89ca-a16433e0707b\" width=\"280\" height=\"372\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"1024\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-41-768x1024.png\" alt=\"\" class=\"wp-image-10837\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-41-768x1024.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-41-225x300.png 225w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-41-1152x1536.png 1152w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-41.png 1200w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<p>But for now, I didn\u2019t succeed.<\/p>\n\n\n\n<p><strong>Sondre:<\/strong><\/p>\n\n\n\n<p>This week i finally got the car to move, and that was such a good feeling. The big breakthrough came when i found out that PlatformIO already had the Adafruit library. Before i was trying to write alot of the code myself, but with the library i didn\u2019t need to do all that hard work from scratch. It made things alot easier and i could just focus on getting the robot to actually drive.<\/p>\n\n\n\n<p>I also tried to make the project more organized. I put code into the <strong>include<\/strong> folder and the <strong>lib<\/strong> folder, so that the main file was short and easy to read. In include i keep the schematic for the mecanum robot, basically the formulas for how each wheel should move. For example the \u201cmecanum\u201d function calculates how much speed to give each motor:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"701\" height=\"150\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-42.png\" alt=\"\" class=\"wp-image-10839\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-42.png 701w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-42-300x64.png 300w\" sizes=\"auto, (max-width: 701px) 100vw, 701px\" \/><\/figure>\n\n\n\n<p>In lib i keep the code for the micro:bit board. That file knows which control channels belong to which motor and sets the duty cycle. For example the \u201csetMotor\u201d function decides which direction and how fast each motor should spin:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"410\" height=\"382\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-45.png\" alt=\"\" class=\"wp-image-10841\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-45.png 410w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-45-300x280.png 300w\" sizes=\"auto, (max-width: 410px) 100vw, 410px\" \/><\/figure>\n\n\n\n<p>That means my <strong>main.cpp<\/strong> can stay really simple and just call nice functions like move_forward(0.8) or turn_left(0.8). For example:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"407\" height=\"171\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-43.png\" alt=\"\" class=\"wp-image-10838\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-43.png 407w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-43-300x126.png 300w\" sizes=\"auto, (max-width: 407px) 100vw, 407px\" \/><\/figure>\n\n\n\n<p>So the main loop is easy to read, almost like giving instructions:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"373\" height=\"46\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-44.png\" alt=\"\" class=\"wp-image-10840\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-44.png 373w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-44-300x37.png 300w\" sizes=\"auto, (max-width: 373px) 100vw, 373px\" \/><\/figure>\n\n\n\n<p>Making functions for the different movements turned out to be pretty easy with this setup. Now i can just call forward(), backward(), strafe, or turn, and the car does it. Testing and changing stuff is way faster now. This week really felt like a big step forward.<\/p>\n\n\n\n<p><strong>Robin:<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\">The Arm&nbsp;<\/h2>\n\n\n\n<p>I&#8217;ve started modeling a robotic arm designed to transport packages from point A to point B. To begin, I searched online for references to help me with the 3D model&#8217;s design.&nbsp;&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-medium-font-size\">Internet Research<\/h3>\n\n\n\n<p>Here is what I found:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.hiwonder.com\/products\/mecanum-wheel-chassis-car?_pos=32&amp;_sid=ef923f775&amp;_ss=r\">https:\/\/www.hiwonder.com\/products\/mecanum-wheel-chassis-car?_pos=32&amp;_sid=ef923f775&amp;_ss=r<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"822\" height=\"699\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-46.png\" alt=\"\" class=\"wp-image-10842\" style=\"width:335px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-46.png 822w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-46-300x255.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-46-768x653.png 768w\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"739\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-47.png\" alt=\"\" class=\"wp-image-10843\" style=\"width:346px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-47.png 750w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-47-300x296.png 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-48-1024x1024.png\" alt=\"\" class=\"wp-image-10844\" style=\"width:390px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-48-1024x1024.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-48-300x300.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-48-150x150.png 150w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-48-768x768.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-48.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-49-1024x1024.png\" alt=\"\" class=\"wp-image-10845\" style=\"width:344px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-49-1024x1024.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-49-300x300.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-49-150x150.png 150w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-49-768x768.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-49.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I used the second image to create the robot&#8217;s supports. Using the dimensions shown in the size chart, I was able to scale the image to 1:1 in my 3D software, Fusion 360.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>I imported the image onto my 3D plane.<\/li>\n\n\n\n<li>I used the provided dimensions for scaling.<\/li>\n\n\n\n<li>I verified the calibration by measuring other parts of the plan, which will ensure that my models have the correct proportions<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading has-medium-font-size\">Support Design&nbsp;<\/h3>\n\n\n\n<p>I started by modeling the top plate of the car from an image.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"594\" height=\"422\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-50.png\" alt=\"\" class=\"wp-image-10846\" style=\"width:413px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-50.png 594w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-50-300x213.png 300w\" sizes=\"auto, (max-width: 594px) 100vw, 594px\" \/><\/figure>\n\n\n\n<p>Now we can move on to manufacturing the support model.<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"567\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-51-1024x567.png\" alt=\"\" class=\"wp-image-10847\" style=\"width:439px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-51-1024x567.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-51-300x166.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-51-768x425.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-51.png 1520w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading has-medium-font-size\">Arm Design<\/h3>\n\n\n\n<p>Next, I moved on to modeling the arm.<\/p>\n\n\n\n<p><a href=\"https:\/\/grabcad.com\/library\/servo-horn-5\">Free CAD Designs, Files &amp; 3D Models | The GrabCAD Community Library<\/a><\/p>\n\n\n\n<p>Here is the first version of the arm :&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"756\" height=\"567\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-52.png\" alt=\"\" class=\"wp-image-10848\" style=\"width:340px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-52.png 756w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-52-300x225.png 300w\" sizes=\"auto, (max-width: 756px) 100vw, 756px\" \/><\/figure>\n\n\n\n<p><strong>3D-Printed Parts:<\/strong><br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"567\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-53-1024x567.png\" alt=\"\" class=\"wp-image-10849\" style=\"width:357px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-53-1024x567.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-53-300x166.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-53-768x425.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-53.png 1520w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Laser-Cut Parts:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"743\" height=\"743\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-54.png\" alt=\"\" class=\"wp-image-10850\" style=\"width:347px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-54.png 743w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-54-300x300.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-54-150x150.png 150w\" sizes=\"auto, (max-width: 743px) 100vw, 743px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading has-medium-font-size\">Chassis Modeling<\/h3>\n\n\n\n<p>Since I had some extra time, I also modeled the car in 3D. This will be useful for visualizing future mechanical improvements and testing new designs.<\/p>\n\n\n\n<p>Here is the result of the chassis model.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"567\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-55-1024x567.png\" alt=\"\" class=\"wp-image-10851\" style=\"width:416px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-55-1024x567.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-55-300x166.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-55-768x425.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-55.png 1520w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>3D model of everything<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"567\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-56-1024x567.png\" alt=\"\" class=\"wp-image-10852\" style=\"width:456px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-56-1024x567.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-56-300x166.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-56-768x425.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/09\/image-56.png 1520w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Anette:<\/strong><\/p>\n\n\n\n<p>This week I have been working on the project structure. This Monday we discussed and finalised the details of our project. This is what we came up with, details might change:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>microbit 1 (original): pickup mechanism + motors<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>microbit 2: distance sensors<\/li>\n<\/ul>\n\n\n\n<p>Where exactly the robot will operate<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The car will operate in a maze with a set path. We need to figure out the width and length of the path in order to know how far from the wall the car needs to be before turning. We will check this on Monday due to not having access to the cave before now.<\/li>\n<\/ul>\n\n\n\n<p>How it will behave in the set space<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The car will travel down a straight path while measuring the sides in order to stay in the middle, and measure the front to see where the path takes a turn. When reaching an end the car will measure which side the wall is on in order to know what way to turn. Then it will drive close enough to turn while monitoring the distance from the sides. When reaching a wall with nowhere to turn the car will know this is the box and proceed to the pickup process. Then it will keep maneuvering its way to the end of the path.<\/li>\n<\/ul>\n\n\n\n<p>Where is the delivery point<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For now the delivery point will be at the end of the path, but we might expand on this later<\/li>\n<\/ul>\n\n\n\n<p>Order of operations<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Movement\u00a0<\/li>\n\n\n\n<li>Check for wall in front<\/li>\n\n\n\n<li>Decide if it is a box or wall by using the side sensors to look for a side without a wall<\/li>\n\n\n\n<li>If box, reverse a bit, lower arm and pick up box\u00a0<\/li>\n\n\n\n<li>finish the path<\/li>\n\n\n\n<li>set box down at the end of the path<\/li>\n<\/ul>\n\n\n\n<p>We also started working on the presentation by looking through the points on canvas, seeing what we could do and what we need to get done.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week, our group has started preparing the presentation for the project. We discussed the key points we want to include, such as the problem domain, our project structure, and the technical solutions we have developed. Each member has taken responsibility for different sections, and we have begun drafting slides and organizing the flow so [&hellip;]<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[104],"class_list":["post-10835","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-pickmebot"],"_links":{"self":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/10835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10835"}],"version-history":[{"count":1,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/10835\/revisions"}],"predecessor-version":[{"id":10853,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/10835\/revisions\/10853"}],"wp:attachment":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}