Customer:
I’d like to supplement my question as you suggested. Could you write a MicroBit program for the servo motor I mentioned earlier, specifically for a ramp application? When a train approaches the ramp should lower, and when the train passes the ramp should rise. I may be writing the program incorrectly in MicroBit, which is why the servo doesn’t seem to complete the task and wait in idle state for the next command. Thank you.
Original message (Croatian)
Poštovanje! Evo još bi dopunio svoij upit kako ste i sugerirali. DAli je problem da mi napišete program u Microbitu za prije navedeni servo motor i to za rampu , dakle kada vlak ide rampa se spušta i kada vlak prođe rampa se diže. Možda ja krivo pišem program u Microbitu pa zato se servo ne ponaša kao da je odradio posao i čeka u stanju mirovanja do sljedeće naredbe. Puno hvala. LP [name removed] Milat
Originally submitted via email support on 5 February 2022. Migrated to the forum for community visibility.
Soldered Support:
When a servo motor reaches its set angle it turns off, but sometimes it buzzes in place because the internal electronics continuously adjust direction to achieve the perfect angle, moving it slightly left and right, which causes it to heat up. You can try writing code that moves the motor a few degrees further and then returns it by that amount, but a better option is to use a function that disconnects the motor each time (in the Arduino servo library this is detach()). We don’t use MicroBit ourselves, so we’re unable to write the code for you, but there are many good examples available online that you can use to learn how to program MicroBit with a servo motor.
Original message (Croatian)
Servo motor kada dostigne postavljeni kut se ugasi, ali ponekad se zna dogoditi da zuji u mjestu zato što elektronika unutar njega stalno mijenja smjer i želi postići savršeni kut pa ga zato pomiče malo lijevo, malo desno i zato se motor grije. Možete probati u kodu napisati da se motor pomakne par stupnjeva više pa ga onda vratite za tu vrijednost nazad, a druga bolja opcija je da svaki puta koristite funkciju koja bi odspojila motor (U Arduino servo libraryu je to deatach()), Na žalost ne koristimo MicroBit pa nismo u mogućnosti napisati kod za Vas, ali postoji dosta dobrih primjera na internetu koje možete iskoristiti kako bi naučili programirati MicroBit i servo motor.