Werner
Published © CC0

Calliope mini Bot

Vorstellung eines einfachen autonomen Roboterfahrzeugs mit dem Calliope mini.

IntermediateWork in progress4 hours2,127
Calliope mini Bot

Things used in this project

Hardware components

Calliope mini
Calliope mini
×1
Roboter Chassis
×1
Distanzsensor
×1
IR Reflexkoppler
×1

Software apps and online services

pxt.calliope.cc

Story

Read more

Schematics

PXT Blöcke

Code

Linienfolger

JavaScript
Beispielprogramm für den Calliope mini Bot
let hell = 0
pins.setPull(DigitalPin.C17, PinPullMode.PullNone)
while (!(input.buttonIsPressed(Button.A))) {
    basic.pause(50)
}
basic.pause(500)
while (true) {
    while (pins.digitalReadPin(DigitalPin.P1) == 1) {
        hell = pins.analogReadPin(AnalogPin.C17)
        motors.dualMotorPower(Motor.AB, 0)
        if (hell > 850) {
            motors.dualMotorPower(Motor.A, 75)
        } else {
            if (hell < 550) {
                motors.dualMotorPower(Motor.B, 75)
            } else {
                motors.dualMotorPower(Motor.AB, 75)
            }
        }
        basic.pause(2)
    }
    motors.dualMotorPower(Motor.AB, 0)
    basic.showArrow(ArrowNames.South)
    basic.pause(200)
    basic.clearScreen()
    basic.pause(200)
}

Credits

Werner

Werner

1 project • 5 followers

Comments