Skip to content

Instantly share code, notes, and snippets.

@peow2373
peow2373 / readme.txt
Created September 16, 2020 21:16
Solve the Puzz to escape the Fuzz (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@peow2373
peow2373 / readme.txt
Created September 16, 2020 20:52
Solve the Puzz to escape the Fuzz (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@peow2373
peow2373 / Puzzle.txt
Created September 16, 2020 20:28
Solve the puzzle and bribe the fuzz to get out of trouble!
title Solve the Puzz to escape the Fuzz
author Perry Owens
homepage https://peow2373.wixsite.com/portfolio
again_interval 0.1
========
OBJECTS
========
@peow2373
peow2373 / Final_Project_V14.INO
Created May 6, 2020 18:27
The game "Simon" recreated with a strip of neopixels, where six different buttons are associated with a different color. The strip will display a certain order of colors, and the corresponding buttons must be pressed in the same order.
const int GREENledPin = 9; // Green LED pin
const int REDledPin = 10; // Red LED pin
const int BLUEledPin = 11; // Blue LED pin
const int GREEN_Button = 8; // the green button
const int RED_Button = 2; // the red button
const int BLUE_Button = 3; // the blue button
const int VIOLET_Button = 4; // the violet button
const int ORANGE_Button = 5; // the orange button
const int YELLOW_Button = 6; // the yellow button
@peow2373
peow2373 / Final_Project.INO
Created April 29, 2020 03:58
Currently lights up a strip of six neopixels Red, Green, and Blue when a button is pressed.
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
#define ON_BUTTON 3 // Digital Input from ON/OFF button
#define BUTTON_PIN 4 // Digital Input from Hexagonal Panel
#define PIXEL_PIN 2 // Digital Output connected to the NeoPixels.
@peow2373
peow2373 / Stepper_Motor_Control.INO
Created April 15, 2020 05:44
Makes a stepper motor rotate one revolution at a time, before pausing, and then rotating again
#include <Stepper.h>
const int stepsPerRevolution = 64; // change this to fit the number of steps per revolution
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(60);
@peow2373
peow2373 / DC_Motor_Control.INO
Created April 15, 2020 05:34
Swaps the direction in which a DC motor is rotating when a switch has a HIGH input
const int switchPin = 2; // switch input
const int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A)
const int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A)
const int enablePin = 9; // H-bridge enable pin
void setup() {
// set the switch as an input:
pinMode(switchPin, INPUT);
// set all the other pins you're using as outputs:
@peow2373
peow2373 / Fruit_Ninja.INO
Created March 11, 2020 06:56
Arduino code to receive x and y inputs from a joystick which is then communicated to the serial monitor. The code also checks for incoming values from the serial monitor to determine when to turn off the LEDs.
// These constants won't change. They're used to give names to the pins used:
int xAxis = A0; // Analog input pin that the x-axis of the joystick is attached to
int yAxis = A1; // Analog input pin that the y-axis of the joystick is attached to
int sensorValue1 = 0; // value read from the potentometer
int sensorValue2 = 0; // calue read from the photoreceptor
int LEDpin1 = 4;
int LEDpin2 = 7;
int LEDpin3 = 8;
@peow2373
peow2373 / p5_to_Arduino.INO
Created March 11, 2020 06:23
Checks the serial monitor for incoming values to signal whether to turn an LED on or off
int LEDpin = 4;
int incomingByte;
void setup() {
pinMode(LEDpin, OUTPUT);
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {
@peow2373
peow2373 / Arduino_to_p5.INO
Created March 11, 2020 06:21
Reads the values from two analog inputs and prints those values to the serial monitor
// These constants won't change. They're used to give names to the pins used:
int analogInPin1 = A0; // Analog input pin that the first potentiometer is attached to
int analogInPin2 = A1; // Analog input pin that the second potentiometer is attached to
int sensorValue1 = 0; // value read from the first potentiometer
int sensorValue2 = 0; // calue read from the second potentiometer
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);