A receipt printer connected to GPT-3 backend.
Building this device is fairly simple. You need:
| import serial | |
| import time | |
| import struct | |
| import datetime | |
| import matplotlib.pyplot as plt | |
| # for use with sds021 sensor or similar | |
| # https://www.aliexpress.com/item/NOVA-PM2-5-Air-particle-dust-sensor-SDS021-laser-inside-digital-output-SDS021-Laser-PM2-5/32638192686.html | |
| # replace with your serial port |
| # converts ballot images from sf elections into a csv you can easily import into your database/spreadsheet | |
| # this is released into the public domain. dana sniezko, 2018 | |
| # download the text file from https://sfelections.sfgov.org/june-5-2018-election-results-detailed-reports | |
| ballot_image_file = "20180606_ballotimage.txt" | |
| # what you want to name your output csv | |
| output_file_name = "parsed_ballots.csv" | |
| # from http://www.sfelections.org/results/20180605/data/20180605_4/20180605_4_masterlookup.txt | |
| # dictionary of to precincts |
| # pre-coffee code in the public domain | |
| # this shows total 1,2,3 votes for a given candidate, it's not running RCV rounds | |
| # for that you want https://sfelections.sfgov.org/june-5-2018-election-results-summary | |
| total = {"001":0,"002":0,"003":0} # total by rank | |
| # http://www.sfelections.org/results/20180605/data/20180605_4/20180605_4_masterlookup.txt | |
| target = "0000184" # amy here! | |
| # ballot images from https://sfelections.sfgov.org/june-5-2018-election-results-detailed-reports |
| { | |
| "name": "LEDPatternTest", | |
| "description": "Testing WS2801 LED Strip on Intel Edison", | |
| "version": "0.0.0", | |
| "main": "main.js", | |
| "engines": { | |
| "node": ">=0.10.0" | |
| }, | |
| "dependencies": { "mqtt": "^0.3.11" } | |
| } |
| <!doctype html> | |
| <head> | |
| <title>LEDBOT SIMULATOR</title> | |
| <style type="text/css"> | |
| body { background:#333; color:#fff; } | |
| #leds { margin:20px; } | |
| </style> | |
| </head> | |
| <body> | |
| <canvas width="1200" height="600" id="leds"></canvas> |
| <html> | |
| <head> | |
| <title>Get some RGBA data from canvas!</title> | |
| </head> | |
| <body> | |
| <h1>Get RGBs from canvas</h1> | |
| <canvas id="acanvas" width="300" height="300"></canvas> | |
| </body> | |
| <script type="text/javascript"> | |
| ;(function() { |
| from flask import Flask | |
| import RPi.GPIO as gpio | |
| gpio.setmode(gpio.BCM) | |
| led_pin = 16 | |
| gpio.setup(led_pin,gpio.OUT) | |
| gpio.output(led_pin,False) |