Skip to content

Instantly share code, notes, and snippets.

/*
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>
require "net/http"
require "uri"
require "rubygems"
require "json"
your_total_nyancoins = 0
uri = URI.parse("https://www.cryptopia.co.nz/api/GetMarket/2609")
# Shortcut
import base58
import Crypto.Hash.SHA256 as SHA256
def double_sha256(s):
return SHA256.new(SHA256.new(s).digest()).digest()
message = raw_input('Enter your message: ')
print("Converting:", message)
message_hex = message.encode('hex')
/*
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>
#!/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
import settings
import twitter
import json
import time
import pycurl
from io import BytesIO
import dataset
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")
#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
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
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