1. Download and install the mBlock app
2. Connect mBot Ranger to the mBlock app
(1) Enable Bluetooth on your smart device.
(2) Power on mBot Ranger.
(3) Tap to open the mBlock app.
(4) Tap Coding, and tap + on the page that appears.
(5) In the Sprite Library, choose Devices > mBot Ranger and tap √.
(6) Tap the mBot Ranger setting icon and then tap Connect on the Device setting page that appears.
(7) Place your smart device close to mBot Ranger.
After the connection is complete, a voice message is played, indicating that the connection is successful.
3. Write a program
(1) Tap Back to coding.
(2) Set the programming mode to Live.
(3) Drag blocks to the scripts area.
() to the scripts area and put it into the condition block."},"attribs":{"0":"*0+n*1+9*0|1+e*0+32"}},"apool":{"numToAttrib":{"0":["author","7100746261334294529"],"1":["author","7010587221652717572"]},"nextNum":2}},"align":"","folded":false}},"BeCIdgWO8ok6akxMf9CcDDUxnUg":{"id":"BeCIdgWO8ok6akxMf9CcDDUxnUg","snapshot":{"type":"text","parent_id":"A54jdm1E1o1PPExtGzPcafvNnbe","comments":[],"locked":false,"hidden":false,"author":"7100746261334294529","children":[],"text":{"initialAttributedTexts":{"text":{"0":"Tap the value 50 to change it to 9."},"attribs":{"0":"*0+z"}},"apool":{"numToAttrib":{"0":["author","7100746261334294529"]},"nextNum":1}},"align":"","folded":false}},"A54jdm1E1o1PPExtGzPcafvNnbe":{"id":"A54jdm1E1o1PPExtGzPcafvNnbe","snapshot":{"type":"page","parent_id":"","comments":null,"locked":false,"hidden":false,"author":"7100746261334294529","children":["UWaid8iUYosogwxWsBhcdYzxnEf","UQaOdwwCGoMoKexyobwcFWGFnjd","JocGdYuQ0oQSgQxyQ3QcipXenxg","JsAUdGsKKoKCswxyAsicArshn8b","A22MdYioCoSasOxyICOcVVMknBc","Vyc6dyAkoogAmCxy273cDL9an3e","J4aKdi4KWouyWcxkpfIcZGtFnmf","EwUYdyEkWowOe4xWUFGcjmBWnud","C0wAdigk6oUkGwxyCDNcHcOvn1f","BYWAdycsAoSuioxGQz1c2WItnDc","M8yodMEYyoeuesxCQyfcNQy5nJf","JQIOdoOYwo4k8qxABjEcHrN1nje","UgAedcyogoEAOUxOCQDcKIvonzg","QAW4dAyIGoMmE2xJsvkcGIkUnba","PASYdMwUcoKEI2xAZhCcDOaknbh","CWMOdIa0ko8S4Wx3xiYcWSgEnvg","GIMgdcAWMoIIcex6qD6c0Qbxn0g","Jm4Kdg8YKouSCkxCFkOcyjLPnYQ","WeOMdkskeoyW2YxgFgAcjNjjnpg","L6qIdOEKYokWMGxcZbGcDPEdnMc","DuU6dycCCoeeIuxG8kccPyqqntg","AkQIdU4gMos0uGx2xSHcAbKRno3","QMCGdi8gIo8ACwxYNkYc91Mpnfc","H646dmEa8o4CwOx2ZMNcCtTMnQg","JI88dkSSqoSQo2x87SUcFAZbnVc","TiAIdSE2Aoeemcxv62DcZKUJnGj","TeQMda0A6oQeEKxsPwTckoA0nif","BcS4de4kcossCUxmKdLcn4i3nEe","Xo0edySwgoEMguxAzyAcdHYKnBd","Jy8ydueeKowGUKxIsvgc3uRlnnb","MEKOd4SuyoCgWoxk3VmcFIE6nkf","Ho4GdUgyIo6sO4xY5zlc7VfUnAb","E6c2dWes2oYii6x6SdAcAkGrnnf","RiEEdIySEoigCgxSSPnc9sP9nre","D4UkdqYkmoyUekxcxlVcweO1nUc","UmqGdIY2wo8MqSxgZGScTSkFnbh","Ja2sdEScgok0Q4xkn6NcAbZBnqf","Lk8Ed2MEOoiWwUxgjZ1cSdf1nAc","R6CWdOEgWoaOeaxmq96cZAeonud","ZoKGd8QMMoYGISx8HRIcmUzenif","Vc4wd0OIGo44goxQhNIc0GDEnjf","Vc4IduK8IoKUsSxoNqJcfJNzn9c","VyQ2dwOygogUQqxaQ7YcwxE7ntd","Py42dEGSIoiOMexGHbScKKKvnxc","EU4MdUSGSogcymxSAojcmf7tnRe","EG4adkEc8oqGwSx4pBXcFl7anJg","Iwykd80G6oswQexS3NFcSAVpnEw","EWomdImWKoq4Q6xMszXcSKdUnNN","F4uqd0YWWoeWmWxKM0scABzBn6b","IuSydyYSooQiI4xsL89clB98n2g","BmWcdecAuo2WGmx8Dtect5Y6nph","Pawad6SqIoCU0qxk3pycZ2HRnmd","VecUdskc8oAUwgxCexScLm4pnHe","NW0wd8CwwouIq4x8h2Xc8Hygnyf","PY6Ud0yuqouI2GxOieZceuFynVc","DskCdqiiAoMsoKx2T98cwufynvh","YyaOdIEsMo4WEAxUrTKcLi2On5e","HM4udmcgyo6A0wxagVpcPx8Yn0d","BeCIdgWO8ok6akxMf9CcDDUxnUg","EK4adyoKCo4y2Sxcg82cIUgFnU0","JouIdSISwouwEix0KZfcZcy2nRg","X6WKdyCmgoqI6qx0AGxcMHe1nPe","JSCSd66uEowmKOxJrbUcazVSnFg","ToMudSIQqoWSuAxi2ZxccjASnnh","OoqQdSKIEoeuiox6za4cweivnMd","OCAcdeEakoEyuwxCs8bc1wkOnCh","NeECdeSCCoEIC8x0UU4cDGPfnQg","Pyeed8MeIouuAgxgbuBcNX61nOW","OwGSdGQIYo4Wsix8Qp6cTICpnCV","DcwYdGCOOomKoexWGw5cOcW1n7e","OG20dQiEeoo42MxoXhDc9SCsnTd","N4awdCcSuoqw0wxAzGhc6v2vnag","FSUudWQYuoEyqIx0gQMcnwexn7b","J6Qadi2oGoc8eux2mtUcJuK7nL8","L6Q6dIgEoo4qWSxwey3cxxGGnid","M0Ugdu4MmogooUx41gTcfRsEnUh","V4ikdiAoKokGAgxU1TzcNKuhn1d","XOGWd2ew2ogUiKxU9NccTwd8nlf","PUSMd266OoU64QxkBFYctoBKnAh","DMYIds4UaoMeWMx8ADHcwxYgnrc"],"text":{"initialAttributedTexts":{"text":{"0":"Program mBot Ranger with the mBlock 5 App"},"attribs":{"0":"*0+15"}},"apool":{"numToAttrib":{"0":["author","7100746261334294529"]},"nextNum":1}},"align":""}}},"payloadMap":{"HM4udmcgyo6A0wxagVpcPx8Yn0d":{"level":1},"BeCIdgWO8ok6akxMf9CcDDUxnUg":{"level":1}},"extra":{"mention_page_title":{},"external_mention_url":{}},"isKeepQuoteContainer":false,"selection":[{"id":67,"type":"text","selection":{"start":0,"end":156},"recordId":"HM4udmcgyo6A0wxagVpcPx8Yn0d"},{"id":68,"type":"text","selection":{"start":0,"end":35},"recordId":"BeCIdgWO8ok6akxMf9CcDDUxnUg"}],"pasteFlag":"9c521061-72ce-468f-afc9-a3eca3323148"}" data-lark-record-format="docx/record" class="lark-record-clipboard"
4. Run the program
-
You can change the parameter values on the blocks (e.g., change the distance threshold and responses) or add more conditions to compile your own obstacle avoidance program.
-
You can also compile other programs (such as a line following program) in a similar way.
foward at power 50%, and drag it to the Scripts Area. Click to unfold the drop-down menu and select turn left."},"attribs":{"0":"*0+9*0*1+6*0+1*0*1+j*0+29*0*1+9*0+1"}},"apool":{"numToAttrib":{"0":["author","7010587221652717572"],"1":["bold","true"]},"nextNum":2}},"align":"","folded":false}},"A54jdm1E1o1PPExtGzPcafvNnbe":{"id":"A54jdm1E1o1PPExtGzPcafvNnbe","snapshot":{"type":"page","parent_id":"","comments":null,"locked":false,"hidden":false,"author":"7100746261334294529","children":["UWaid8iUYosogwxWsBhcdYzxnEf","UQaOdwwCGoMoKexyobwcFWGFnjd","JocGdYuQ0oQSgQxyQ3QcipXenxg","JsAUdGsKKoKCswxyAsicArshn8b","A22MdYioCoSasOxyICOcVVMknBc","Vyc6dyAkoogAmCxy273cDL9an3e","J4aKdi4KWouyWcxkpfIcZGtFnmf","EwUYdyEkWowOe4xWUFGcjmBWnud","C0wAdigk6oUkGwxyCDNcHcOvn1f","BYWAdycsAoSuioxGQz1c2WItnDc","M8yodMEYyoeuesxCQyfcNQy5nJf","JQIOdoOYwo4k8qxABjEcHrN1nje","UgAedcyogoEAOUxOCQDcKIvonzg","QAW4dAyIGoMmE2xJsvkcGIkUnba","PASYdMwUcoKEI2xAZhCcDOaknbh","CWMOdIa0ko8S4Wx3xiYcWSgEnvg","GIMgdcAWMoIIcex6qD6c0Qbxn0g","Jm4Kdg8YKouSCkxCFkOcyjLPnYQ","WeOMdkskeoyW2YxgFgAcjNjjnpg","L6qIdOEKYokWMGxcZbGcDPEdnMc","DuU6dycCCoeeIuxG8kccPyqqntg","AkQIdU4gMos0uGx2xSHcAbKRno3","QMCGdi8gIo8ACwxYNkYc91Mpnfc","H646dmEa8o4CwOx2ZMNcCtTMnQg","JI88dkSSqoSQo2x87SUcFAZbnVc","TiAIdSE2Aoeemcxv62DcZKUJnGj","TeQMda0A6oQeEKxsPwTckoA0nif","BcS4de4kcossCUxmKdLcn4i3nEe","Xo0edySwgoEMguxAzyAcdHYKnBd","Jy8ydueeKowGUKxIsvgc3uRlnnb","MEKOd4SuyoCgWoxk3VmcFIE6nkf","Ho4GdUgyIo6sO4xY5zlc7VfUnAb","E6c2dWes2oYii6x6SdAcAkGrnnf","RiEEdIySEoigCgxSSPnc9sP9nre","D4UkdqYkmoyUekxcxlVcweO1nUc","UmqGdIY2wo8MqSxgZGScTSkFnbh","Ja2sdEScgok0Q4xkn6NcAbZBnqf","Lk8Ed2MEOoiWwUxgjZ1cSdf1nAc","R6CWdOEgWoaOeaxmq96cZAeonud","ZoKGd8QMMoYGISx8HRIcmUzenif","Vc4wd0OIGo44goxQhNIc0GDEnjf","Vc4IduK8IoKUsSxoNqJcfJNzn9c","VyQ2dwOygogUQqxaQ7YcwxE7ntd","Py42dEGSIoiOMexGHbScKKKvnxc","EU4MdUSGSogcymxSAojcmf7tnRe","EG4adkEc8oqGwSx4pBXcFl7anJg","Iwykd80G6oswQexS3NFcSAVpnEw","EWomdImWKoq4Q6xMszXcSKdUnNN","F4uqd0YWWoeWmWxKM0scABzBn6b","IuSydyYSooQiI4xsL89clB98n2g","BmWcdecAuo2WGmx8Dtect5Y6nph","Pawad6SqIoCU0qxk3pycZ2HRnmd","VecUdskc8oAUwgxCexScLm4pnHe","NW0wd8CwwouIq4x8h2Xc8Hygnyf","PY6Ud0yuqouI2GxOieZceuFynVc","DskCdqiiAoMsoKx2T98cwufynvh","YyaOdIEsMo4WEAxUrTKcLi2On5e","HM4udmcgyo6A0wxagVpcPx8Yn0d","BeCIdgWO8ok6akxMf9CcDDUxnUg","EK4adyoKCo4y2Sxcg82cIUgFnU0","JouIdSISwouwEix0KZfcZcy2nRg","X6WKdyCmgoqI6qx0AGxcMHe1nPe","JSCSd66uEowmKOxJrbUcazVSnFg","USWYdyq4youIGUxIjg3cIdeJn8g","BOQmdEIcSoiguExCMkVcdYolnSd","ToMudSIQqoWSuAxi2ZxccjASnnh","OoqQdSKIEoeuiox6za4cweivnMd","OCAcdeEakoEyuwxCs8bc1wkOnCh","NeECdeSCCoEIC8x0UU4cDGPfnQg","Pyeed8MeIouuAgxgbuBcNX61nOW","OwGSdGQIYo4Wsix8Qp6cTICpnCV","DcwYdGCOOomKoexWGw5cOcW1n7e","OG20dQiEeoo42MxoXhDc9SCsnTd","N4awdCcSuoqw0wxAzGhc6v2vnag","FSUudWQYuoEyqIx0gQMcnwexn7b","J6Qadi2oGoc8eux2mtUcJuK7nL8","L6Q6dIgEoo4qWSxwey3cxxGGnid","M0Ugdu4MmogooUx41gTcfRsEnUh","V4ikdiAoKokGAgxU1TzcNKuhn1d","XOGWd2ew2ogUiKxU9NccTwd8nlf","PUSMd266OoU64QxkBFYctoBKnAh","DMYIds4UaoMeWMx8ADHcwxYgnrc"],"text":{"initialAttributedTexts":{"text":{"0":"Program mBot Ranger with the mBlock 5 App"},"attribs":{"0":"*0+15"}},"apool":{"numToAttrib":{"0":["author","7100746261334294529"]},"nextNum":1}},"align":""}}},"payloadMap":{"OCAcdeEakoEyuwxCs8bc1wkOnCh":{"level":1},"NeECdeSCCoEIC8x0UU4cDGPfnQg":{"level":1}},"extra":{"mention_page_title":{},"external_mention_url":{}},"isKeepQuoteContainer":false,"selection":[{"id":75,"type":"text","selection":{"start":0,"end":66},"recordId":"OCAcdeEakoEyuwxCs8bc1wkOnCh"},{"id":77,"type":"text","selection":{"start":0,"end":126},"recordId":"NeECdeSCCoEIC8x0UU4cDGPfnQg"}],"pasteFlag":"9c521061-72ce-468f-afc9-a3eca3323148"}" data-lark-record-format="docx/record" class="lark-record-clipboard"
Comments
Please sign in to leave a comment.