Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Smart CreativityWizard OfCircuit
Published Β© CC BY

Make a walking robot at home/ Circuitplayground/ #Sc

Hello friends, in this tutorial we will see to how to make a diy walking robot at home using circuitplaygroundexpress.

BeginnerFull instructions provided1 hour508
Make a walking robot at home/ Circuitplayground/ #Sc

Things used in this project

Hardware components

SG90 Micro-servo motor
SG90 Micro-servo motor
Γ—1
Circuit Playground Express
Adafruit Circuit Playground Express
Γ—1
Jumper wires (generic)
Jumper wires (generic)
Γ—1
ESD Tape, Antistatic
ESD Tape, Antistatic
Γ—1

Software apps and online services

MakeCode
Microsoft MakeCode

Story

Read more

Code

robot code

Scratch
upload this code..
 input.buttonA.onEvent(ButtonEvent.Click, function () {
    for (let i = 0; i < 4; i++) {
        pins.A1.servoWrite(90)
        pins.A2.servoWrite(90)
        pause(200)
        pins.A1.servoWrite(95)
        pins.A2.servoWrite(95)
        pause(200)
        pins.A1.servoWrite(100)
        pins.A2.servoWrite(100)
        pause(200)
        pins.A1.servoWrite(105)
        pins.A2.servoWrite(105)
        pause(200)
        pins.A1.servoWrite(110)
        pins.A2.servoWrite(110)
        pause(200)
        pins.A1.servoWrite(115)
        pins.A2.servoWrite(115)
        pause(200)
        pins.A1.servoWrite(120)
        pins.A2.servoWrite(120)
        pause(200)
        pins.A1.servoWrite(125)
        pins.A2.servoWrite(125)
        pause(200)
        pins.A1.servoWrite(130)
        pins.A2.servoWrite(130)
        pause(200)
    }
})
input.onLoudSound(function () {
    for (let i = 0; i < 4; i++) {
        pins.A1.servoWrite(20)
        pause(500)
        pins.A1.servoWrite(160)
        pause(500)
        pins.A2.servoWrite(160)
        pause(500)
        pins.A2.servoWrite(20)
        pause(500)
    }
})
forever(function () {

})
forever(function () {
    light.showAnimation(light.rainbowAnimation, 2000)
    pause(2000)
    light.showAnimation(light.colorWipeAnimation, 2000)
    pause(2000)
})

Credits

Smart Creativity
25 projects β€’ 36 followers
A creative student....πŸ§’πŸ§’πŸ§‘
Contact
Wizard OfCircuit
9 projects β€’ 4 followers
My name is Deepak Kumar.I am a software and hardware designer.I am also working in microcontrollers like microbit, circuit playground etc.
Contact
Thanks to Deepak- smartcreativity.

Comments

Please log in or sign up to comment.