İçeriğe Geç

Projeler

#24 Money Box Project With micro:bit

Tarafından PicoBricks Team 16 Jun 2025

PicoBricks Money Box can detect objects placed in its receptacle through distance sensor in the front of it and automatically lifts its receptacle to take in these objects.

In this project, when the distance sensor detects the object placed in the receptacle , the servo motor connected to the motor driver is adjusted to the angle specified in the code, and then the object inside the receptacle is dropped into the Money Box.

Connection Diagram:

You can assemble this project by breaking apart the PicoBricks modules at the proper points.

Project Images:


Setup Steps of The Project


MakeCode Code of The Project


Python Code of The Project:


#Money Box Project
from microbit import *
from picobricks import *

# Function Initialization
motor = motordriver()
motor.servo(1,180)

trashDetected=0
distance=100

while True:
    rawdistance=measure_distance()
    if rawdistance<1200:
        distance=rawdistance
    motor.servo(1,180)
    sleep(500)
    if distance<5:
        trashDetected=1
        sleep(300)
    if distance>9 and trashDetected==1:
        trashDetected=0
        motor.servo(1,90)
        sleep(500)

MicroBlocks Code of The Project

Önceki Gönderi
Sıradaki Gönderi

Abone olduğun için teşekkürler!

Bu e-posta kaydedildi!

Görünümü satın alın
Seçenekleri Seçin

Picobricks
Özel güncellemeler için kaydolun, yeni gelenler ve yalnızca içeriden öğrenenler için indirimler

Seçeneği Düzenle

Stok Bildirimi

Karşılaştır

Ürün Stok KoduDeğerlendirmeAçıklama Kategori Uygunluk Ürün Tipi Diğer Detaylar
this is just a warning
Giriş Yap
Alışveriş Sepeti
0 Ürünler
Same Day Shipping No Extra Costs
Easy Returns Guarantee Return with Ease
Secure Checkout Secure Payment