Skip to content

Instantly share code, notes, and snippets.

View pollbite's full-sized avatar
🌿
studying

Lily Battin pollbite

🌿
studying
View GitHub Profile
@pollbite
pollbite / finalwithworkingwin.ino
Created May 7, 2023 02:00
Final code for tap racing game (with comments)
#include <Adafruit_NeoPixel.h>
#include <DailyStruggleButton.h>
// pins for all the buttons
#define GO_BUTTON 13
#define PLAYER_1 12
#define PLAYER_2 8
#define RESET_BUTTON 7
// pints for all the LEDS
@pollbite
pollbite / finalwithworkingwin.ino
Created May 7, 2023 01:53
Final code for simple tap racing game
#include <Adafruit_NeoPixel.h>
#include <DailyStruggleButton.h>
// pins for all the buttons
#define GO_BUTTON 13
#define PLAYER_1 12
#define PLAYER_2 8
#define RESET_BUTTON 7
// pints for all the LEDS
@pollbite
pollbite / buttontest.ino
Created May 7, 2023 01:51
Simple testing code for four arcade buttons
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(13, INPUT_PULLUP);
pinMode(12, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
}
@pollbite
pollbite / RGBWstrandtest.ino
Created May 7, 2023 01:50
Testing code for two Adafruit Neopixel strips
// NeoPixel test program showing use of the WHITE channel for RGBW
// pixels only (won't look correct on regular RGB NeoPixel strips).
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1:
@pollbite
pollbite / finalproject.ino
Created April 28, 2023 23:35
Final code with issues
#include <Adafruit_NeoPixel.h>
// pins for all the buttons
#define GO_BUTTON 13
#define PLAYER_1 12
#define PLAYER_2 8
#define RESET_BUTTON 7
// pints for all the LEDS
#define LED_PIN_PLAYER_1 5
@pollbite
pollbite / drawingJoystick.ino
Created April 5, 2023 00:09
Ellipse drawing with joystick (update)
void setup() { // Executes once
size(640, 480);
// Specifying the USB port to which the Arduino is connected
// And attaching to the serial object
// ##### CHANGE FOR YOUR MACHINE, CHECK IN ARDUINO IDE #####
String portName = "COM3";
port = new Serial(this, portName, 9600);
@pollbite
pollbite / changingFollowMe.ino
Created April 5, 2023 00:01
Interactive system with follow me cursor and joystick, potentiometer and button
import processing.serial.*; // Importing the Serial library
import java.util.Map; // Importing library to use HashMap
Serial port; // Creating an object to handle serial communication
// String variable to store the received serial string
String serialString;
// Dictionary for all the values received over serial
HashMap<String, Integer> serialData = new HashMap<String, Integer>();
@pollbite
pollbite / valuesforProcessing.ino
Created April 4, 2023 23:58
Outputting values for processing
const int swPin = 3;
const int digPinX = A0;
const int digPinY = A1;
const int potenPin = A2;
const int buttonPin = 5;
void setup() {
pinMode(swPin, INPUT_PULLUP);
Serial.begin(9600);
pinMode(potenPin, INPUT);
@pollbite
pollbite / drawingJoystick.ino
Created April 4, 2023 21:57
Drawing with a joystick
String serialString;
// Dictionary for all the values received over serial
HashMap<String, Integer> serialData = new HashMap<String, Integer>();
void setup() { // Executes once
size(640, 480);
// Specifying the USB port to which the Arduino is connected
// And attaching to the serial object
@pollbite
pollbite / drawnEllipseExample.ino
Created March 17, 2023 19:59
Drawn ellipse example
void setup() { // Executes once
// Creates a window of size width 640, height 480
size(640, 480);
}
void draw() { // Executes in a constant loop
fill(208,1,125);
ellipse(mouseX, mouseY, 5, 5);
}