Skip to content

Instantly share code, notes, and snippets.

@Corteil
Corteil / Dtest.py
Created April 7, 2021 19:59
Dictionary example
colours = {'red': (254, 0, 0), 'green': (0, 254, 0), 'blue': (0, 0, 254), 'black': (0, 0, 0) }
# functions
def displayColour(colour):
global colours
print(f"{colour}'s RGB Value is { colours[colour] }")
# Main
@Corteil
Corteil / appControl.py
Created February 5, 2021 21:04
python flask robot control app
'''
Raspberry Pi robot controller
'''
import RPi.GPIO as GPIO
from flask import Flask, render_template, request, jsonify
from time import sleep, time
import board
import busio
@Corteil
Corteil / index.html
Created February 5, 2021 21:00
Robot control index page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tiny 4WD Web Control</title>
<link rel="stylesheet" href='../static/style.css'/>
</head>