File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
MicroPython_NeoPixel_Blink Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ # SPDX-FileCopyrightText: 2022 Kattni Rembor for Adafruit Industries
2+ # SPDX-License-Identifier: MIT
3+ import time
4+ from machine import Pin
5+ from neopixel import NeoPixel
6+
7+ power_pin = Pin (8 , Pin .OUT ) # NeoPixel power is on pin 8
8+ power_pin .on () # Enable the NeoPixel Power
9+
10+ pin = Pin (5 , Pin .OUT ) # Onboard NeoPixel is on pin 5
11+ np = NeoPixel (pin , 1 ) # create NeoPixel driver on pin 5 for 1 pixel
12+
13+ while True :
14+ np .fill ((0 , 0 , 150 )) # Set the NeoPixel blue
15+ np .write () # Write data to the NeoPixel
16+ time .sleep (0.5 ) # Pause for 0.5 seconds
17+ np .fill ((0 , 0 , 0 )) # Turn the NeoPixel off
18+ np .write () # Write data to the NeoPixel
19+ time .sleep (0.5 ) # Pause for 0.5 seconds
You can’t perform that action at this time.
0 commit comments