Skip to content

Instantly share code, notes, and snippets.

View piersstorey's full-sized avatar

Piers Storey piersstorey

View GitHub Profile
@piersstorey
piersstorey / main.py
Created November 29, 2023 22:22
MeArm Servo testing
from servo import Servo
my_servo = Servo(pin_id=0, freq=50)
my_servo.write(10)
@piersstorey
piersstorey / counter_test.py
Created November 28, 2023 20:51
⌚ Wasp-os Examples and Commands
import wasp
import icons
import fonts
from micropython import const
class CounterApp():
"""Class and methods to set and run a simple counter."""
NAME = "Counter"
ICON = icons.app # Get built in 2-bit RLE icon
@piersstorey
piersstorey / mearm.py
Created October 29, 2023 12:09
MeArm Python
import os
import math
import pigpio
pi = pigpio.pi()
class Servo:
def __init__(self, config):
self.pin = config['pin']
self.min = config['min']
@piersstorey
piersstorey / OHLCV_aggregator .py
Created January 16, 2018 07:49
Jupyter OHLCV aggregator
# coding: utf-8
# In[1]:
import datetime
import numpy as np
import pandas as pd
import requests
@piersstorey
piersstorey / cryptocompare_api.py
Last active January 14, 2018 14:53
Cryptocompare Python API wrapper
# Class for cryptocompare API requests
# Core imports
from pprint import pprint
# Third party imports
import requests
class CryptoCompareAPI():
@piersstorey
piersstorey / README.md
Created January 10, 2018 23:12
Bittrex Gsheet Market Summary

Python libraries

pip install google-api-python-client
pip install python-bittrex

Get your client_secret.json following https://developers.google.com/sheets/api/quickstart/python and add it to the app root folder Add your Bittrex API BITTREX_API_KEY and BITTREX_API_SECRET as environmental variables

@piersstorey
piersstorey / emoji_messenger.py
Created May 14, 2017 10:04
Emoji Messenger
# A micro:bit Emoji messenger.
# By Piers & Ethan. Released to the public domain.
import radio
from microbit import display, Image, button_a, button_b
image_list = [
Image.HAPPY,
Image.SAD,
Image.CONFUSED,
Image.ASLEEP,
@piersstorey
piersstorey / flask_xlsxwriter.py
Last active March 30, 2019 13:23
Flask xlsx writer
from flask import Response
import StringIO, mimetypes
import xlsxwriter
from datetime import datetime
from werkzeug.datastructures import Headers
def xlsx_export():
try:
# Flask response
response = Response()