/ PyLeap_Bluefruit_Touch_NeoPixel_Rainbow / code.py
code.py
1 # SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries 2 # 3 # SPDX-License-Identifier: MIT 4 5 """ 6 Circuit Playground Bluefruit Capacitive Touch Rainbow 7 8 Touch the each of the touchpads around the outside of the board to light up the pixels a different 9 color for each pad touched. 10 """ 11 from adafruit_circuitplayground import cp 12 13 cp.pixels.brightness = 0.3 14 15 while True: 16 if cp.touch_A1: 17 cp.pixels.fill((255, 0, 0)) 18 if cp.touch_A2: 19 cp.pixels.fill((210, 45, 0)) 20 if cp.touch_A3: 21 cp.pixels.fill((155, 100, 0)) 22 if cp.touch_A4: 23 cp.pixels.fill((0, 255, 0)) 24 if cp.touch_A5: 25 cp.pixels.fill((0, 135, 125)) 26 if cp.touch_A6: 27 cp.pixels.fill((0, 0, 255)) 28 if cp.touch_TX: 29 cp.pixels.fill((100, 0, 155))