Browse Source

initial commit: stub code, library dependencies, license, readme

Brennen Bearnes 2 years ago
commit
9c5caa5d3f
61 changed files with 176 additions and 0 deletions
  1. 21
    0
      LICENSE
  2. 34
    0
      README.md
  3. 2
    0
      lib/README.txt
  4. 26
    0
      lib/VERSIONS.txt
  5. BIN
      lib/adafruit_bno055.mpy
  6. 1
    0
      lib/adafruit_bus_device/__init__.py
  7. BIN
      lib/adafruit_bus_device/i2c_device.mpy
  8. BIN
      lib/adafruit_bus_device/spi_device.mpy
  9. 0
    0
      lib/adafruit_circuitplayground/__init__.py
  10. BIN
      lib/adafruit_circuitplayground/express.mpy
  11. BIN
      lib/adafruit_ds3231.mpy
  12. 30
    0
      lib/adafruit_hid/__init__.py
  13. BIN
      lib/adafruit_hid/keyboard.mpy
  14. BIN
      lib/adafruit_hid/keyboard_layout_us.mpy
  15. BIN
      lib/adafruit_hid/keycode.mpy
  16. BIN
      lib/adafruit_hid/mouse.mpy
  17. 0
    0
      lib/adafruit_ht16k33/__init__.py
  18. BIN
      lib/adafruit_ht16k33/ht16k33.mpy
  19. BIN
      lib/adafruit_ht16k33/matrix.mpy
  20. BIN
      lib/adafruit_ht16k33/segments.mpy
  21. BIN
      lib/adafruit_is31fl3731.mpy
  22. 1
    0
      lib/adafruit_lis3dh/__init__.py
  23. BIN
      lib/adafruit_lis3dh/lis3dh.mpy
  24. BIN
      lib/adafruit_max31855.mpy
  25. BIN
      lib/adafruit_mcp9808.mpy
  26. 1
    0
      lib/adafruit_mpr121/__init__.py
  27. BIN
      lib/adafruit_mpr121/mpr121.mpy
  28. 0
    0
      lib/adafruit_pca9685/__init__.py
  29. BIN
      lib/adafruit_pca9685/motor.mpy
  30. BIN
      lib/adafruit_pca9685/pca9685.mpy
  31. BIN
      lib/adafruit_pca9685/servo.mpy
  32. BIN
      lib/adafruit_pca9685/stepper.mpy
  33. BIN
      lib/adafruit_pcf8523.mpy
  34. 0
    0
      lib/adafruit_register/__init__.py
  35. BIN
      lib/adafruit_register/i2c_bcd_alarm.mpy
  36. BIN
      lib/adafruit_register/i2c_bcd_datetime.mpy
  37. BIN
      lib/adafruit_register/i2c_bit.mpy
  38. BIN
      lib/adafruit_register/i2c_bits.mpy
  39. BIN
      lib/adafruit_register/i2c_struct.mpy
  40. 1
    0
      lib/adafruit_rgb_display/__init__.py
  41. BIN
      lib/adafruit_rgb_display/hx8353.mpy
  42. BIN
      lib/adafruit_rgb_display/ili9341.mpy
  43. BIN
      lib/adafruit_rgb_display/rgb.mpy
  44. BIN
      lib/adafruit_rgb_display/s6d02a1.mpy
  45. BIN
      lib/adafruit_rgb_display/ssd1331.mpy
  46. BIN
      lib/adafruit_rgb_display/ssd1351.mpy
  47. BIN
      lib/adafruit_rgb_display/st7735.mpy
  48. BIN
      lib/adafruit_rtttl.mpy
  49. BIN
      lib/adafruit_sdcard.mpy
  50. BIN
      lib/adafruit_si7021.mpy
  51. 1
    0
      lib/adafruit_ssd1306/__init__.py
  52. BIN
      lib/adafruit_ssd1306/ssd1306.mpy
  53. BIN
      lib/adafruit_thermistor.mpy
  54. 0
    0
      lib/adafruit_waveform/__init__.py
  55. BIN
      lib/adafruit_waveform/sine.mpy
  56. BIN
      lib/dotstar.mpy
  57. BIN
      lib/neopixel.mpy
  58. BIN
      lib/simpleio.mpy
  59. 15
    0
      lib/update_linux.sh
  60. 16
    0
      lib/update_macosx.command
  61. 27
    0
      main.py

+ 21
- 0
LICENSE View File

@@ -0,0 +1,21 @@
1
+MIT License
2
+
3
+Copyright (c) 2017 Brennen Bearnes
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy
6
+of this software and associated documentation files (the "Software"), to deal
7
+in the Software without restriction, including without limitation the rights
8
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+copies of the Software, and to permit persons to whom the Software is
10
+furnished to do so, subject to the following conditions:
11
+
12
+The above copyright notice and this permission notice shall be included in all
13
+copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+SOFTWARE.

+ 34
- 0
README.md View File

@@ -0,0 +1,34 @@
1
+wzrd.py: a circuit playground express wizard staff
2
+==================================================
3
+
4
+I am really just fumbling around with Adafruit's
5
+[CircuitPython][circuitpython], a fork of [MicroPython][micropython].
6
+
7
+This code targets the [Circuit Playground Express][playground], which I am
8
+affixing to a staff I found in a corner of a converted garage I shared with
9
+[Living Arts Floral][livingarts] for a few years.  (Need flowers in the Lyons,
10
+CO area?  You can't go wrong with Jeralyn - tell her I sent you.)
11
+
12
+dependencies
13
+------------
14
+
15
+* [Circuit Playground Express][playground]
16
+* [Adafruit_CircuitPython_Bundle][bundle] for various libraries
17
+
18
+author
19
+------
20
+
21
+Brennen Bearnes  
22
+https://p1k3.com/
23
+
24
+copying
25
+-------
26
+
27
+I like the GPL, but for this project I'm following my upstream dependencies and
28
+going with the MIT License.
29
+
30
+[circuitpython]: https://github.com/adafruit/circuitpython
31
+[micropython]: https://micropython.org/
32
+[playground]: https://www.adafruit.com/product/3333
33
+[livingarts]: http://livingartsfloral.com/
34
+[bundle]: https://github.com/adafruit/Adafruit_CircuitPython_Bundle

+ 2
- 0
lib/README.txt View File

@@ -0,0 +1,2 @@
1
+See here for more info: https://github.com/adafruit/Adafruit_CircuitPython_Bundle
2
+See VERSIONS.txt for version info.

+ 26
- 0
lib/VERSIONS.txt View File

@@ -0,0 +1,26 @@
1
+65a60f7
2
+https://github.com/adafruit/circuitpy/releases/tag/1.0.0
3
+https://github.com/adafruit/Adafruit_CircuitPython_BNO055/releases/tag/0.1.3
4
+https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/releases/tag/0.1.1
5
+https://github.com/adafruit/Adafruit_CircuitPython_DotStar/releases/tag/1.0.0
6
+https://github.com/adafruit/Adafruit_CircuitPython_DS3231/releases/tag/1.0.0
7
+https://github.com/adafruit/Adafruit_CircuitPython_HT16K33/releases/tag/1.0.2
8
+https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731/releases/tag/0.1.0
9
+https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH/releases/tag/0.1.1
10
+https://github.com/adafruit/Adafruit_CircuitPython_MAX31855/releases/tag/0.1.1
11
+https://github.com/adafruit/Adafruit_CircuitPython_MCP9808/releases/tag/0.1.1
12
+https://github.com/adafruit/Adafruit_CircuitPython_MPR121/releases/tag/0.1.1
13
+https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel/releases/tag/1.0.0-rc.1
14
+https://github.com/adafruit/Adafruit_CircuitPython_PCA9685/releases/tag/1.0.2
15
+https://github.com/adafruit/Adafruit_CircuitPython_PCF8523/releases/tag/0.1.0
16
+https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display/releases/tag/1.0.1
17
+https://github.com/adafruit/Adafruit_CircuitPython_SD/releases/tag/0.9.0
18
+https://github.com/adafruit/Adafruit_CircuitPython_SI7021/releases/tag/0.1.3
19
+https://github.com/adafruit/Adafruit_CircuitPython_SSD1306/releases/tag/1.0.2
20
+https://github.com/adafruit/Adafruit_CircuitPython_Thermistor/releases/tag/0.1.2
21
+https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/releases/tag/0.3.0
22
+https://github.com/adafruit/Adafruit_CircuitPython_HID/releases/tag/1.1.0
23
+https://github.com/adafruit/Adafruit_CircuitPython_Register/releases/tag/1.0.0
24
+https://github.com/adafruit/Adafruit_CircuitPython_RTTTL/releases/tag/0.1.0
25
+https://github.com/adafruit/Adafruit_CircuitPython_SimpleIO/releases/tag/0.2.0
26
+https://github.com/adafruit/Adafruit_CircuitPython_Waveform/releases/tag/0.1.1

BIN
lib/adafruit_bno055.mpy View File


+ 1
- 0
lib/adafruit_bus_device/__init__.py View File

@@ -0,0 +1 @@
1
+

BIN
lib/adafruit_bus_device/i2c_device.mpy View File


BIN
lib/adafruit_bus_device/spi_device.mpy View File


+ 0
- 0
lib/adafruit_circuitplayground/__init__.py View File


BIN
lib/adafruit_circuitplayground/express.mpy View File


BIN
lib/adafruit_ds3231.mpy View File


+ 30
- 0
lib/adafruit_hid/__init__.py View File

@@ -0,0 +1,30 @@
1
+# The MIT License (MIT)
2
+#
3
+# Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
4
+#
5
+# Permission is hereby granted, free of charge, to any person obtaining a copy
6
+# of this software and associated documentation files (the "Software"), to deal
7
+# in the Software without restriction, including without limitation the rights
8
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+# copies of the Software, and to permit persons to whom the Software is
10
+# furnished to do so, subject to the following conditions:
11
+#
12
+# The above copyright notice and this permission notice shall be included in
13
+# all copies or substantial portions of the Software.
14
+#
15
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+# THE SOFTWARE.
22
+
23
+"""
24
+`adafruit_hid`
25
+====================================================
26
+
27
+This driver simulates USB HID devices. Currently keyboard and mouse are implemented.
28
+
29
+* Author(s): Scott Shawcroft, Dan Halbert
30
+"""

BIN
lib/adafruit_hid/keyboard.mpy View File


BIN
lib/adafruit_hid/keyboard_layout_us.mpy View File


BIN
lib/adafruit_hid/keycode.mpy View File


BIN
lib/adafruit_hid/mouse.mpy View File


+ 0
- 0
lib/adafruit_ht16k33/__init__.py View File


BIN
lib/adafruit_ht16k33/ht16k33.mpy View File


BIN
lib/adafruit_ht16k33/matrix.mpy View File


BIN
lib/adafruit_ht16k33/segments.mpy View File


BIN
lib/adafruit_is31fl3731.mpy View File


+ 1
- 0
lib/adafruit_lis3dh/__init__.py View File

@@ -0,0 +1 @@
1
+from adafruit_lis3dh.lis3dh import *

BIN
lib/adafruit_lis3dh/lis3dh.mpy View File


BIN
lib/adafruit_max31855.mpy View File


BIN
lib/adafruit_mcp9808.mpy View File


+ 1
- 0
lib/adafruit_mpr121/__init__.py View File

@@ -0,0 +1 @@
1
+from adafruit_mpr121.mpr121 import MPR121

BIN
lib/adafruit_mpr121/mpr121.mpy View File


+ 0
- 0
lib/adafruit_pca9685/__init__.py View File


BIN
lib/adafruit_pca9685/motor.mpy View File


BIN
lib/adafruit_pca9685/pca9685.mpy View File


BIN
lib/adafruit_pca9685/servo.mpy View File


BIN
lib/adafruit_pca9685/stepper.mpy View File


BIN
lib/adafruit_pcf8523.mpy View File


+ 0
- 0
lib/adafruit_register/__init__.py View File


BIN
lib/adafruit_register/i2c_bcd_alarm.mpy View File


BIN
lib/adafruit_register/i2c_bcd_datetime.mpy View File


BIN
lib/adafruit_register/i2c_bit.mpy View File


BIN
lib/adafruit_register/i2c_bits.mpy View File


BIN
lib/adafruit_register/i2c_struct.mpy View File


+ 1
- 0
lib/adafruit_rgb_display/__init__.py View File

@@ -0,0 +1 @@
1
+from adafruit_rgb_display.rgb import color565

BIN
lib/adafruit_rgb_display/hx8353.mpy View File


BIN
lib/adafruit_rgb_display/ili9341.mpy View File


BIN
lib/adafruit_rgb_display/rgb.mpy View File


BIN
lib/adafruit_rgb_display/s6d02a1.mpy View File


BIN
lib/adafruit_rgb_display/ssd1331.mpy View File


BIN
lib/adafruit_rgb_display/ssd1351.mpy View File


BIN
lib/adafruit_rgb_display/st7735.mpy View File


BIN
lib/adafruit_rtttl.mpy View File


BIN
lib/adafruit_sdcard.mpy View File


BIN
lib/adafruit_si7021.mpy View File


+ 1
- 0
lib/adafruit_ssd1306/__init__.py View File

@@ -0,0 +1 @@
1
+from adafruit_ssd1306.ssd1306 import *

BIN
lib/adafruit_ssd1306/ssd1306.mpy View File


BIN
lib/adafruit_thermistor.mpy View File


+ 0
- 0
lib/adafruit_waveform/__init__.py View File


BIN
lib/adafruit_waveform/sine.mpy View File


BIN
lib/dotstar.mpy View File


BIN
lib/neopixel.mpy View File


BIN
lib/simpleio.mpy View File


+ 15
- 0
lib/update_linux.sh View File

@@ -0,0 +1,15 @@
1
+#! /bin/bash
2
+latest_release=$(curl -s  "https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Bundle/releases/latest")
3
+download_link=$(echo $latest_release | grep -o "\"browser_download_url\": \"[^\"]*" | cut -d \" -f 4)
4
+tag=$(echo $latest_release | grep -o "\"tag_name\": \"[^\"]*" | cut -d \" -f 4)
5
+current=$(head -n 1 VERSIONS.txt | tr -d '[:space:]')
6
+if [ $? -ne 0 ]
7
+then echo "No VERSIONS.txt please run from lib/"
8
+fi
9
+if [ $current == $tag ]
10
+then echo "Already updated to the latest."; exit 0
11
+fi
12
+save_to=~/Downloads/$(basename $download_link)
13
+echo "Downloading to " $save_to
14
+curl -sL $download_link > $save_to
15
+unzip -o $save_to -d ..

+ 16
- 0
lib/update_macosx.command View File

@@ -0,0 +1,16 @@
1
+#! /bin/bash
2
+cd $(dirname $0)
3
+latest_release=$(curl -s "https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Bundle/releases/latest")
4
+download_link=$(echo $latest_release | grep -o "\"browser_download_url\": \"[^\"]*" | cut -d \" -f 4)
5
+tag=$(echo $latest_release | grep -o "\"tag_name\": \"[^\"]*" | cut -d \" -f 4)
6
+current=$(head -n 1 VERSIONS.txt | tr -d '[:space:]')
7
+if [ $? -ne 0 ]
8
+then echo "No VERSIONS.txt please run from lib/"
9
+fi
10
+if [ $current == $tag ]
11
+then echo "Already updated to the latest."; exit 0
12
+fi
13
+save_to=~/Downloads/$(basename $download_link)
14
+echo "Downloading to " $save_to
15
+curl -sL $download_link > $save_to
16
+unzip -o $save_to -d ..

+ 27
- 0
main.py View File

@@ -0,0 +1,27 @@
1
+import adafruit_thermistor
2
+import board
3
+import neopixel
4
+
5
+# https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel
6
+pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, auto_write=False)
7
+
8
+# https://github.com/adafruit/Adafruit_CircuitPython_Thermistor
9
+thermistor = adafruit_thermistor.Thermistor(board.TEMPERATURE, 10000, 10000, 25, 3950)
10
+
11
+# i can't think in degrees celsius to save my life
12
+temp_cold = 5
13
+temp_comfort = 27
14
+temp_hot = 46
15
+temp_range = temp_hot - temp_cold
16
+
17
+while True:
18
+    temp_current = thermistor.temperature
19
+    if temp_current > temp_comfort:
20
+        color = (50, 0, 0);
21
+    else:
22
+        color = (0, 0, 50);
23
+
24
+    for pixel in range(0, 9):
25
+        pixels[pixel] = color
26
+
27
+    pixels.show()

Loading…
Cancel
Save