{"id":1021,"date":"2025-06-10T07:34:08","date_gmt":"2025-06-10T07:34:08","guid":{"rendered":"https:\/\/yesa.org.za\/resources\/?page_id=1021"},"modified":"2025-06-10T07:34:08","modified_gmt":"2025-06-10T07:34:08","slug":"microbit-accelerometer","status":"publish","type":"page","link":"https:\/\/yesa.org.za\/resources\/microbit\/microbit-accelerometer\/","title":{"rendered":"Microbit Accelerometer"},"content":{"rendered":"<ul>\n<li><a href=\"https:\/\/makecode.microbit.org\/reference\/input\/acceleration\" target=\"_blank\" rel=\"noopener\">Micro:Bit Acceleration<\/a><br \/>\n<a href=\"https:\/\/www.youtube.com\/watch?v=byngcwjO51U\" target=\"_blank\" rel=\"noopener\">Video &#8211; Behind the MakeCode Hardware\u00a0<\/a><br \/>\nForces in space<br \/>\nSince we don\u2019t live on a flat world, forces happen in three dimensional space. If the movement of an object isn\u2019t exactly in the direction of one axis, we need a way to calculate its acceleration from the values measured for all the axes together.<br \/>\nIf you put your micro:bit on a level table and push it diagonally, you have an acceleration in two dimensions. You can find the acceleration in that direction just like how you calculate the long side of a triangle using the two shorter sides (X and Y):<br \/>\nstrength2D = Math.sqrt((accelX * accelX) + (accelY * accelY))<br \/>\nIf you decide to lift your micro:bit off the table, then you\u2019ve just added another dimension, so insert the acceleration value for the Z axis into the equation:<br \/>\nstrength3D = Math.sqrt((accelX * accelX) + (accelY * accelY) + (accelZ * accelZ))<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Micro:Bit Acceleration Video &#8211; Behind the MakeCode Hardware\u00a0 Forces in space Since we don\u2019t live on a flat world, forces happen in three dimensional space. If the movement of an object isn\u2019t exactly in the direction of one axis, we need a way to calculate its acceleration from the values measured for all the axes [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":69,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1021","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/pages\/1021","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/comments?post=1021"}],"version-history":[{"count":1,"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/pages\/1021\/revisions"}],"predecessor-version":[{"id":1022,"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/pages\/1021\/revisions\/1022"}],"up":[{"embeddable":true,"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/pages\/69"}],"wp:attachment":[{"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/media?parent=1021"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}