This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using MQTTnet; | |
using MQTTnet.Client; | |
using PPt = Microsoft.Office.Interop.PowerPoint; | |
using System.Runtime.InteropServices; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SocketServer | |
import SimpleHTTPServer | |
import math | |
import json | |
import pantilthat | |
pantilthat.pan(0) | |
pantilthat.tilt(0) | |
PORT = 9090 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cv2 | |
import pantilthat | |
import picamera | |
pantilthat.pan(0) | |
pantilthat.tilt(0) | |
faceCascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') | |
camera = picamera.PiCamera() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Christmas tree bauble countdown timer for ESP8266 with 128x32 OLED display | |
#include <Arduino.h> | |
#include <ESP8266WiFi.h> | |
#include <ESP8266WiFiMulti.h> | |
#include <ESP8266HTTPClient.h> | |
#include "SSD1306.h" | |
#include <ArduinoJson.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ws281x = require('rpi-ws281x-native'); | |
var tinycolor = require("tinycolor2"); | |
var mqtt = require('mqtt'); | |
var font5x7 = require('./font.js'); | |
var fs = require('fs'); | |
try { | |
var xy = require('./xy.json'); | |
} | |
catch (ex) { | |
var xy = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"interactionModel": { | |
"languageModel": { | |
"invocationName": "my house", | |
"intents": [ | |
{ | |
"name": "AMAZON.CancelIntent", | |
"samples": [] | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set environment variable BIN_CALENDAR_URL to the specific ical calendar for your postcode | |
# https://refusecalendarapi.azurewebsites.net/calendar/ical/<id> where <id> can be found | |
# interactively using https://www.cambridge.gov.uk/check-when-your-bin-will-be-emptied | |
from urllib2 import urlopen | |
from datetime import datetime, timedelta | |
import os | |
from ask_sdk_core.skill_builder import SkillBuilder | |
from ask_sdk_core.dispatch_components import ( | |
AbstractRequestHandler, AbstractExceptionHandler, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dependencies": { | |
"azure-iot-device-amqp": "^1.3.0", | |
"azure-iot-device-amqp-ws": "^1.0.16", | |
"request": "^2.83.0", | |
"serialport": "^6.0.4", | |
"tinycolor2": "^1.4.1", | |
"tempfile": "^2.0.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var DeviceClient = require('azure-iot-device').Client | |
var DeviceProtocol = require('azure-iot-device-amqp').AmqpWs; | |
var exec = require('child_process').exec; | |
var tempfile = require('tempfile'); | |
var fs = require('fs'); | |
var SerialPort = require("serialport"); | |
var request = require('request'); | |
var connectionString = "HostName=[...]"; | |
var azureCognitiveServicesAuthEndpoint = 'https://northeurope.api.cognitive.microsoft.com/sts/v1.0/issueToken'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var azureCognitiveServicesMainEndpoint = 'https://northeurope.tts.speech.microsoft.com/cognitiveservices/v1'; | |
function azureCallApi(text, callback) { | |
var ssml = "<speak version='1.0' xmlns=\"http://www.w3.org/2001/10/synthesis\" xml:lang='en-US'>" + | |
"<voice name='Microsoft Server Speech Text to Speech Voice (en-GB, George, Apollo)'>" + | |
"<prosody rate=\"slow\">" + | |
text + | |
"</prosody>" + | |
"</voice>" + | |
"</speak>"; |
NewerOlder