ELECFREAKS
Published

How to make a simple nucleic acid sampling machine

Nucleic acid testing has long been a part of our daily life as the epidemic has become normal. So can we make a simple nucleic acid sampling

BeginnerShowcase (no instructions)114
How to make a simple nucleic acid sampling machine

Things used in this project

Hardware components

BBC micro:bit V2
×1
360°servo
×1
Ultrasonic sensor
×1
Nezha Breakout board
Building Blocks x N Paper cups or any other containers x 5 Cotton swabs x N
×1

Software apps and online services

Hardware Source with microbit

Story

Read more

Code

How to make a simple nucleic acid sampling machine

JavaScript
basic.showIcon(IconNames.Happy)
neZha.setServoAngel(neZha.ServoTypeList._360, neZha.ServoList.S1, 10)
neZha.setServoAngel(neZha.ServoTypeList._360, neZha.ServoList.S2, 170)
neZha.setServoAngel(neZha.ServoTypeList._360, neZha.ServoList.S3, 50)
basic.forever(function () {
    if (PlanetX_Basic.ultrasoundSensor(PlanetX_Basic.DigitalRJPin.J1, PlanetX_Basic.Distance_Unit_List.Distance_Unit_cm) <= 20) {
        neZha.setServoAngel(neZha.ServoTypeList._360, neZha.ServoList.S2, 20)
        basic.pause(1000)
        neZha.setServoAngel(neZha.ServoTypeList._360, neZha.ServoList.S3, 180)
        basic.pause(3000)
        neZha.setServoAngel(neZha.ServoTypeList._360, neZha.ServoList.S3, 50)
        basic.pause(1000)
        neZha.setServoAngel(neZha.ServoTypeList._360, neZha.ServoList.S2, 170)
        basic.pause(1000)
        neZha.setServoAngel(neZha.ServoTypeList._360, neZha.ServoList.S1, 45)
        basic.pause(1000)
    } else {
        neZha.setServoAngel(neZha.ServoTypeList._360, neZha.ServoList.S1, 10)
        neZha.setServoAngel(neZha.ServoTypeList._360, neZha.ServoList.S2, 170)
        neZha.setServoAngel(neZha.ServoTypeList._360, neZha.ServoList.S3, 50)
    }
})

Credits

ELECFREAKS

ELECFREAKS

11 projects • 0 followers
ELECFREAKS focuses on the micro:bit developed kits and accessories. We are one of the official partners of the BBC micro:bit Foundation.

Comments