View CoffeeRoasting.ino
#include "MAX31855.h" | |
const int doPin = 7; | |
const int csPin = 6; | |
const int clPin = 5; | |
const int relayPin = 13; | |
MAX31855 tc(clPin, csPin, doPin); | |
float getTemp() { |
View AnimateBilly.h
#include <AFMotor.h> | |
#define NUM_MOTORS 3 | |
AF_DCMotor head(1, MOTOR12_1KHZ); // create motor #2, 64KHz pwm | |
AF_DCMotor mouth(2, MOTOR12_1KHZ); | |
AF_DCMotor tail(3, MOTOR34_1KHZ); | |
void runMotorOnOff(AF_DCMotor motor, int aniDelay = 500){ | |
motor.run(FORWARD); |
View AudioDiagnostic.ino
int sensorPin = A0; // select the input pin for the audio signal input | |
int ledPin = 13; | |
void setup() { | |
// declare the ledPin as an OUTPUT and sensorPin as input | |
pinMode(ledPin, OUTPUT); | |
pinMode(sensorPin, INPUT); | |
Serial.begin(9600); // open the serial port at 9600 bps: | |
} |
View MotorDiagnostic.ino
#include <AFMotor.h> | |
#define NUM_MOTORS 3 | |
AF_DCMotor head(1, MOTOR12_1KHZ); | |
AF_DCMotor mouth(2, MOTOR12_1KHZ); | |
AF_DCMotor tail(3, MOTOR34_1KHZ); | |
AF_DCMotor motors[NUM_MOTORS] = {head, mouth, tail}; | |
void setup() { | |
Serial.begin(9600); // set up Serial library at 9600 bps |
View shift_youtube.py
import sys | |
alphabet = ["a", "b", "c", "d","e","f","g","h", "i", "j", | |
"k", "l", "m", "n","o","p", "q", "r","s", "t", | |
"u", "v", "w", "x", "y", "z"] | |
class ShiftCipher: | |
def __init__(self, N = 13): | |
self.cipher_alphabet = alphabet[N:] | |
self.cipher_alphabet.extend(alphabet[0:N]) |
View shift.py
class ShiftCipher: | |
def __init__(self, N = 13): | |
self.original_alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m", | |
"n","o","p","q","r","s","t","u","v","w","x","y","z"] | |
self.cipher_alphabet = self.original_alphabet[N:] | |
self.cipher_alphabet.extend(self.original_alphabet[0:N]) | |
def encrypt_message(self, message): | |
encrypted = "" | |
#lowercase the message as alphabets are lowercase |
View shift_3.py
class ShiftCipher: | |
[...] | |
import sys | |
if __name__ == "__main__": | |
if len(sys.argv) < 3: | |
print("Not enough arguments, please provide e/d followed by the message") | |
N = 13 | |
cipher = ShiftCipher(N) |
View shift_2.py
class ShiftCipher: | |
def __init__(self, N = 13): | |
[...] | |
def encrypt_message(self, message): | |
encrypted = "" | |
#lowercase the message as alphabets are lowercase | |
message = message.lower() | |
for letter in message: | |
if self.original_alphabet.count(letter) > 0: |
View shift_1.py
class ShiftCipher: | |
def __init__(self, N = 13): | |
self.original_alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m", | |
"n","o","p","q","r","s","t","u","v","w","x","y","z"] | |
self.cipher_alphabet = self.original_alphabet[N:] | |
self.cipher_alphabet.extend(self.original_alphabet[0:N]) | |
View fire.ino
// NeoPixel Ring simple sketch (c) 2013 Shae Erisson | |
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library | |
#include <Adafruit_NeoPixel.h> | |
#ifdef __AVR__ | |
#include <avr/power.h> | |
#endif | |
// Which pin on the Arduino is connected to the NeoPixels? | |
// On a Trinket or Gemma we suggest changing this to 1 |
NewerOlder