The first example of digital output uses a LED to realize a blinking LED. It can be managed from the Internet via start and stop commands.
Connect the LED as shown in figure 1:
The long PIN is positive as shown in Figure 2.
Write a sketch K to define:
led :: d2
start = [led=!led #1]
stop = [led=0]
or simply load the sketch with the command
] load e01_blink
Try the following commands now:
] ?
--- Pin connections
led :: d2
--- Commands
start = [led=!led#1]
stop = [led=0]
shows the loaded sketch
] start
the led starts blinking
] pause
the flashing of the led stops
] play
the flashing of the led resumes
] ??
--- Periodic commands
led=!led #1
shows the periodic commands running
] trace=1
ok
]
# led=!led
]
# led=!led
...
traces the commands running
] trace=0
ends the tracing
] stop
turns off the led and stops the flashing of the led
] ??
null
stop command also clears the commands running.
In this lesson you learned: