Difference between revisions of "5 Light up all kinds of LED"

From Banana Pi Wiki
Jump to: navigation, search
(Use repl)
Line 36: Line 36:
  
 
[[File:Light_restore.png]]
 
[[File:Light_restore.png]]
 +
 +
==Use mian.py==

Revision as of 23:41, 17 February 2019

Light up all kinds of LED

If Hello World is the beginning of religious programming for software programmers, Blink Led is the same for hardware programmers. All hardware programming starts with lighting a lamp.

So we started to prepare our hardware, and I was using a beta version 1.3. It is sufficient for the purposes of this chapter, and is common to subsequent boards. Therefore, we pay attention to progressive, first a lamp, and then a row of lights.

Error creating thumbnail: Unable to save thumbnail to destination

Use repl

  • Go into repl mode
Error creating thumbnail: Unable to save thumbnail to destination
  • input (after selecting the text to copy, right-click in the black box and paste)
from machine import Pin
  • input again
Pin(18, Pin.OUT).value(1)
Error creating thumbnail: Unable to save thumbnail to destination
  • Make sure that one of the lights on the panel is lit
Error creating thumbnail: Unable to save thumbnail to destination
  • Just to make sure it's the light we're controlling,input
Pin(18, Pin.OUT).value(0)
Error creating thumbnail: Unable to save thumbnail to destination
  • That's when you see it go out
Error creating thumbnail: Unable to save thumbnail to destination

Use mian.py