Skip to content

Instantly share code, notes, and snippets.

import time
import requests
import datetime
from dashing import *
url_address = 'http://localhost:7076'
time_out = 5
ui = HSplit(
VSplit(
#!/usr/bin/env python
import socket
import traceback
import time
TCP_IP = '138.201.94.249'
TCP_PORT = 7075
BUFFER_SIZE = 128
byte_message = bytearray( [ 0x52, 0x43, 0x11, 0x11, 0x0d, 0x02, 0x00, 0x00 ] )
CH926 Devices
Power 12v Power Adaptor
Raspberry Pi Devices
Camera Port Zero Cam
GPIO 1 CH926 LED 1 (1p)
GPIO 2 CH926 LED 2 (2p)
GPIO 3 CH926 LED 3 (5p)
GPIO 4 CH926 LED 4 (10p)
GPIO 5 CH926 LED 5 (20p)
GPIO 6 CH926 LED 6 (50p)
Ground Ground
Power (VCC USB) 5v USB cable + Power Adapter
Parts Source Costs (£)
Raspberry Pi Zero W Pimoroni 9.30
Zero Cam Pimoroni 14.00
CH926 Coin Acceptor Ebay 11.81
Wires and Stuff Junk Box 0
Case 3D Printed 0 (spare filament)
Total = 35.11
#Base code from https://www.eclipse.org/paho/clients/python/ lifted on 29/4/19
import paho.mqtt.client as mqtt
# The callback for when a PUBLISH message is received from the server.
def on_message(client, userdata, msg):
print("{}: {}".format(msg.topic, msg.payload.decode("utf-8") ))
client = mqtt.Client()
client.on_message = on_message
from bitstring import BitArray
import ctypes
library_name = "librai_lib.dylib"
librai = ctypes.CDLL(library_name)
print("Calculating PoW")
work = librai.xrb_work(b"FC5A7FB777110A858052468D448B2DF22B648943C097C0608D1E2341007438B0")
import settings
import twitter
import json
import time
import pycurl
from io import BytesIO
import dataset
#!/bin/sh
export Qt5_DIR=/Users/jamescoxon/Qt/5.8/clang_64
export BOOST_ROOT=/usr/local/Cellar/boost/1.63.0
make clean
git submodule init
git submodule update
/*
UKHASnet rf69_repeater code
based on rf22_client.pde/ino from the RF22 library
*/
#include <SPI.h>
//You'll need to use the RFM69 library from the UKHASnet repo
#include <RFM69.h>