Python board.D12 Examples
The following are 3
code examples of board.D12().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
board
, or try the search function
.
Example #1
Source File: led_strip.py From BerePi with BSD 2-Clause "Simplified" License | 5 votes |
def led_off(pin): if pin == 1: pixels = neopixel.NeoPixel(board.D12, 20) elif pin == 2: pixels = neopixel.NeoPixel(board.D18, 20) else: return False pixels.fill((0, 0, 0)) return True
Example #2
Source File: led_strip.py From BerePi with BSD 2-Clause "Simplified" License | 5 votes |
def led_color(pin, R=255,G=255,B=255): if pin == 1: pixels = neopixel.NeoPixel(board.D12, 20) elif pin == 2: pixels = neopixel.NeoPixel(board.D18, 20) else: return False pixels.fill((R, G, B)) return True
Example #3
Source File: led_strip.py From BerePi with BSD 2-Clause "Simplified" License | 4 votes |
def led_on(pin): if pin == 1: pixels = neopixel.NeoPixel(board.D12, 20) elif pin == 2: pixels = neopixel.NeoPixel(board.D18, 20) else: print("wrong id") return False pixels.fill((255, 255, 255)) return True