Angel Vargas
Published © MIT

Controller

The one is here.

BeginnerFull instructions provided6 hours375
Controller

Things used in this project

Hardware components

Alligator Clips
Alligator Clips
×1
cardboard
×1

Software apps and online services

MakeCode
Microsoft MakeCode
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Tape, Electrical
Tape, Electrical

Story

Read more

Schematics

controller_OAcKB0lOm1.MOV

Code

Code

JavaScript
input.touchA1.onEvent(ButtonEvent.Down, function () {
    mouse.setButton(MouseButton.Left, true)
    light.graph(5, 20)
    light.showRing(
    `red red orange red orange orange red orange red red`
    )
    light.clear()
    mouse.setButton(MouseButton.Left, false)
})
input.onGesture(Gesture.Shake, function () {
    keyboard.key("S", KeyboardKeyEvent.Press)
    light.graph(5, 20)
    light.showRing(
    `white white white white white white white white white white`
    )
    light.clear()
    keyboard.key("S", KeyboardKeyEvent.Up)
})
input.buttonA.onEvent(ButtonEvent.Click, function () {
    keyboard.key("A", KeyboardKeyEvent.Down)
    light.graph(5, 20)
    light.showRing(
    `yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow`
    )
    keyboard.key("A", KeyboardKeyEvent.Up)
    light.clear()
})
input.buttonB.onEvent(ButtonEvent.Click, function () {
    keyboard.key("D", KeyboardKeyEvent.Down)
    light.graph(5, 20)
    light.showRing(
    `green green green green green green green green green green`
    )
    light.clear()
    keyboard.key("D", KeyboardKeyEvent.Up)
})
input.buttonsAB.onEvent(ButtonEvent.Click, function () {
    keyboard.key("W", KeyboardKeyEvent.Down)
    light.graph(5, 20)
    light.showRing(
    `blue blue blue blue blue blue blue blue blue blue`
    )
    light.clear()
    keyboard.key("W", KeyboardKeyEvent.Up)
})
forever(function () {
	
})

Credits

Angel Vargas
4 projects • 1 follower

Comments