Skip to content

Instantly share code, notes, and snippets.

int speakerPin = 3;
int length = 15; // the number of notes
char notes[] = "ccggaagffeeddc "; // a space represents a rest
int beats[] = { 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 4 };
int tempo = 300;
void playTone(int tone, int duration) {
for (long i = 0; i < duration * 1000L; i += tone * 2) {
digitalWrite(speakerPin, LOW);
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2 // DS18B20 pin (use 4?)
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);
const boolean RED[] = {1, 0, 0};
const boolean GREEN[] = {0, 1, 0};
const boolean BLUE[] = {0, 0, 1};
/*
This code is for Pulse Sensor Amped by Joel Murphy and Yury Gitman
*/
// >>>>>>>>>>>>>>>> EXPERIMENT STARTS HERE <<<<<<<<<<<<<<<<
const int minimalIntensity = 10; // min 0, max 255
const int maximumIntensity = 255; // min 0, max 255
const int fadeSpeed = 12; // min 1, max 255
// >>>>>>>>>>>>>>>>>> END OF EXPERIMENT <<<<<<<<<<<<<<<<<<<
#include <ZumoMotors.h>
ZumoMotors motors;
int LeftMotorPin = A0;
int RightMotorPin = A1;
void setup(){
pinMode(LeftMotorPin,INPUT);
pinMode(RightMotorPin,INPUT);
}
char symbols[][2] = {
{0, 'A'}, {1, 'B'}, {2, 'C'}, {3, 'D'},
{4, '3'}, {5, '6'}, {6, '9'}, {7, '#'},
{8, '2'}, {9, '5'}, {10, '8'}, {11, '0'},
{12, '1'}, {13, '4'}, {14, '7'}, {15, '*'}
};
int red = 11;
int green = 12;
int piezo = 10;
int led1 = A0;
int green = 13;
int red = 11;
int yellow = 12;
int button = 10;
int mode = 1;
void changeMode() {
switch(mode) {
case 1:
lightRed();
ball_size = 100
step = 1
def setup():
size(500,500)
def draw():
global ball_size, step
background(127)
fill(255, 0, 0)
score = 0
score2 = 0
ball_x = 250
ball_y = 250
ball_speed_x = 5
ball_speed_y = 5
platform_y = 0
left_platform_color = 0
right_platform_color = 0
ball_x = 50
ball_y = 50
ball_speed_x = 5
ball_speed_y = 5
platform_y = 0
left_platform_color = 0
right_platform_color = 0
def setup():
size(500, 500)