Curriculum
Course: Push Button With Led
Login
Text lesson

Mblock Coding

mBlock Logic

When Arduino Starts Up

Forever

    set buttonState to read digital pin 2

    if buttonState = HIGH

        set pin 13 HIGH
        set pin 8 HIGH

    else

        set pin 13 LOW
        set pin 8 LOW

 

mBlock Style

 

When Arduino Starts Up
Forever
set buttonState to read pin 2
if buttonState = HIGH
Set Pin 13 HIGH
Set Pin 8 HIGH
Else
Set Pin 13 LOW
Set Pin 8 LOW
×
×

Cart