Skip to content

Instantly share code, notes, and snippets.

@huggre
huggre / lambda_function.py
Created Aug 28, 2020
Lambda function for the Amazon Alexa Tutorial
View lambda_function.py
"""
This is a Python template for Alexa to get you building skills (conversations) quickly.
"""
from __future__ import print_function
from iota import Iota
api = Iota('https://nodes.devnet.iota.org:443')
@huggre
huggre / p2p_energy_trade_p2.py
Created Aug 14, 2020
Python code for the "Integrating physical devices with IOTA - Peer-to-peer energy trading with IOTA Part 2" tutorial
View p2p_energy_trade_p2.py
#!/usr/bin/env python
# Import PyOTA library
import iota
from iota import Address
# Import time
import time
# Import the INA3221 library
@huggre
huggre / p2p_energy_trade.py
Last active Jul 24, 2020
Python code for the "Peer-to-peer energy trading with IOTA Part 1" tutorial
View p2p_energy_trade.py
#!/usr/bin/env python
# Import INA219 library
from ina219 import INA219
from ina219 import DeviceRangeError
# Import time
from time import sleep
# Import PyOTA library
View barcodesdb.csv
7030019532240 10
7310070786937 25
View rvm_lib.py
# import the necessary packages
from __future__ import print_function
from PIL import Image
from PIL import ImageTk
import tkinter as tki
from tkinter import scrolledtext
from pyzbar import pyzbar
import threading
import imutils
import cv2
View rvm_app.py
# import the necessary packages
from rvm_lib import ReverseVendingMachine
from imutils.video import VideoStream
import time
# Select web cam. or PiCam
vs = VideoStream(src=0).start()
# vs = VideoStream(usePiCamera=True).start()
print("[INFO] warming up camera...")
View pay_the_light_zigbee_dev2.py
#!/usr/bin/python
# Imports some Python Date/Time functions
import time
import datetime
# Import requests library
import requests
# Import json library
@huggre
huggre / hex_convert.py
Last active Mar 17, 2020
Helper for converting an IOTA address to a C++ hex array
View hex_convert.py
# Imports the textrwap library
from textwrap import wrap
# Replace with your own IOTA payment address
sample = 'NYZBHOVSMDWWABXSACAJTTWJOQRPVVAWLBSFQVSJSWWBJJLLSQKNZFC9XCRPQSVFQZPBJCJRANNPVMMEZQJRQSVVGZ'
# Create a list with 4 characters in each element
mylist = wrap(sample,4)
result = ''
@huggre
huggre / pay_the_light_hue.py
Last active Mar 17, 2020
Python code for the Integrating physical devices with IOTA - Philips Hue edition tutorial
View pay_the_light_hue.py
#!/usr/bin/python
# Imports some Python Date/Time functions
import time
import datetime
# Imports the phue library
from phue import Bridge
# Create a Hue Bridge object
@huggre
huggre / car-iota-p1.py
Last active Mar 17, 2020
Python script for the Car-IOTA tutorial part 1
View car-iota-p1.py
# Imports some required PyOTA libraries
import iota
from iota import Address
# Imports some libraries required by OpenALPR communication
import requests
import base64
import json
# Imports the CSV library used for DB comm.
You can’t perform that action at this time.