Skip to content

Instantly share code, notes, and snippets.

@huggre
huggre / let_there_be_light.py
Last active Mar 17, 2020
Integrating physical devices with IOTA and Python
View let_there_be_light.py
# Imports some Python Date/Time functions
import time
import datetime
# Imports GPIO library
import RPi.GPIO as GPIO
# Imports the PyOTA library
from iota import Iota
from iota import Address
View let_there_be_light_wifi.ino
/*
* This sketch demonstrates how to set up a simple HTTP-like server.
* The server will set a GPIO pin depending on the request
* http://server_ip/gpio/0 will set the GPIO2 low,
* http://server_ip/gpio/1 will set the GPIO2 high
* server_ip is the IP address of the ESP8266 Arduino module, will be
* printed to Serial when the module is connected.
*/
// Include the ESP8266 library
View let_there_be_light_wifi.py
# Import the httplib2 library and create a http object.
import httplib2
http = httplib2.Http()
# Define URL's used when sending http requests
url_on = 'http://192.168.100.9/gpio/1'
url_off = 'http://192.168.100.9/gpio/0'
# Imports some Python Date/Time functions
import time
View let_there_be_light_gui.py
# Import some funtions from TkInter
from tkinter import *
import tkinter.font
import tkinter.ttk
# Import some functions from Pillow
from PIL import ImageTk, Image
# Import the PyQRCode library
import pyqrcode
@huggre
huggre / let_there_be_light.ini
Created Jul 28, 2018
INI file used to store index counter for the get_new_addresses() function
View let_there_be_light.ini
[IndexCounter]
addrindexcount = 0
@huggre
huggre / hourglass.xbm
Created Jul 28, 2018
Hourglass icon in XBM format
View hourglass.xbm
#define 9f6e8ef561174ca49d14dc1aef035896_width 128
#define 9f6e8ef561174ca49d14dc1aef035896_height 128
static char 9f6e8ef561174ca49d14dc1aef035896_bits[] = {
0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFE, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00,
0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFE, 0xFF, 0xFF,
View let_there_be_light_addr.py
# Import the requests library to send http request to coinbase.com
import requests
# Import json library for reading json data returned by the http request
import json
# Import the configparser library used for reading and writing to let_there_be_light.ini
import configparser
# Import some funtions from TkInter
View cleaning_log.py
# Imports from the PyOTA library
from iota import Iota
from iota import Address
from iota import Transaction
from iota import TryteString
# Import json library
import json
# Import datetime libary
View cleaning_register.py
# Import datetime library
from datetime import datetime
# Import GPIO library
import RPi.GPIO as GPIO
# Import simplified version of the MFRC522 library
import SimpleMFRC522
# Import the PyOTA library
View iota_debit_card.py
from iota import Iota
import random
import RPi.GPIO as GPIO
import MFRC522
import signal
from textwrap import wrap
# Set seed to <blank>
seed=""
You can’t perform that action at this time.