/*
Raspberry Pi Pico, 16 x 2 LCD, 3 pushbuttons, 3 leds
Function:
Push button 1, led 1 blinks and a two word phrase is displayed on LCD row 1.
Two word phrase comes from 'wordArray1' and 'wordArray2'.
Push button 2, led 2 blinks and a phrase is displayed on LCD row 2 from 'phraseArray'.
Push button 3, led 3 blinks, LCD screen is cleared and displays text "Want more abuse!"
TO DO:
Create a computer-esk display box.
- DONE!
Notes:
- When using the latest version of LiquidCrystal_I2C library it is no longer required to
include the Wire.h library. The library imports Wire.h automatically.
- For 5 x 8 dot displays, CGRAM can write up to 8 custom characters
Notes 3.0
- The same as 2.0 except for opening screen and for message displayed on button 3 press
- 1/10/25 Added button debounce code
*/
#include <Wire.h> // Library for I2C communication
#include <LiquidCrystal_I2C.h> // Library for I2C LCD
// Create lcd object of class LiquidCrystal_I2C then set LCD I2C address, number of columns and rows
// The PCF8574 chip from NXP Semiconductor uses 0x27 while the PCF8574A chip uses 0x3F.
LiquidCrystal_I2C lcd(0x27, 16, 2);
// Make custom characters: 5 x 8 pixel area
byte Penis[8] = {
0b00100,
0b01010,
0b01110,
0b01010,
0b01010,
0b10001,
0b10101,
0b01010
};
byte Pussy[8] = {
0b00100,
0b01010,
0b10001,
0b10101,
0b10101,
0b10101,
0b01110,
0b00000
};
byte Finger[8] = {
0b00100,
0b00100,
0b01110,
0b11010,
0b10001,
0b10001,
0b01110,
0b01010
};
int adcVSYS = 29; // Internal ADC (ADC3) for measuring VSYS
int adc_reading;
float adc_voltage;
float vsys_voltage;
int ledPin1 = 14; // buttonPin1 led, lit when pressed
int ledPin2 = 15; // buttonPin2 led, lit when pressed
int ledPin3 = 13; // buttonPin3 led, lit when pressed
int volts_OK_led = 21;
int volts_LOW_led = 20;
int buttonPin1 = 6;
int buttonPin2 = 7;
int buttonPin3 = 10;
int buttonRead1;
int buttonRead2;
int buttonRead3;
uint8_t oldButtonRead1 = 0;
uint8_t oldButtonRead2 = 0;
uint8_t oldButtonRead3 = 0;
const uint8_t debounceTime = 10; // milliseconds
unsigned int randNum1;
unsigned int randNum2;
unsigned int randNum3;
unsigned int randNum4;
String wordArray1[60] = {"Ass", "Fuck", "Cock", "Tampon", "Shit", "Penis", "Jizz", "Ball", "Cum", "Fanny",
"Dick", "Bitch", "Douche", "Fart", "Nut", "'Gina", "Piss", "Whore", "Slut", "Mother",
"Sissy", "Wench", "Crap", "Nipple", "Anus", "Retard", "Jerk-Off", "Trash", "Tit", "Snot",
"Scum", "Diaper", "Granny", "Pecker", "Cooch", "Twat", "Mouth", "Rectum", "Wiener", "Cunt",
"Fetus", "Clit", "Ho", "Schlong", "Sack", "Meat", "Pussy", "Testicle", "Dildo", "Prick",
"Scrotum", "Muff", "Panty", "Pube", "Sperm", "Poop", "Butt", "Pork", "Feces", "Queef"
};
String wordArray2[60] = {"Chunk", "Bagger", "Flaps", "Licker", "Munch", "Rammer", "Sucker", "Waffle", "Eater", "Face",
"Biter", "Bucket", "Monkey", "Dumpster", "Jacket", "Junkie", "Chomper", "Lips", "Fucker", "Blower",
"Donkey", "Monster", "Wad", "Jockey", "Dangler", "Skank", "Pooper", "Farm", "Lover", "Shitter",
"Hole", "Pincher", "Beater", "Sniffer", "Wipe", "Twister", "Slammer", "Folds", "Clot", "Glob",
"Jammer", "Fondler", "Tickler", "Fungus", "Plug", "Packer", "Wrangler", "Slime", "Diddler", "Sandwich",
"Gobbler", "Wanker", "Muncher", "Stain", "Boner", "Nugget", "Booger", "Rag", "Basket", "Biscuit"
};
// Make these less mean and more funny
/*
String phraseArray[30] = {"Wake up", "You're a POS", "Pay attention", "Get lost", "Yo' Momma",
"Come here", "Go away", "Beat it!", "Fuck off", "You make me gag",
"Make my sandwich" "Blow me", "Lick my ass", "You suck", "Ya' Puke",
"Bend over", "Get bent", "Tickle my ass", "Fuck you", "Don't like you",
"You'll do", "You stink", "Bag your head", "Grab your ankles", "Bite me",
"Kiss my ring", "Lick my boot", "Eat shit", "Pull my finger", "Sniff my finger"
};
*/
String phraseArray[30] = {"Wake up", "Piece of work", "Pay attention", "Get lost", "Shag yer mum",
"Lick bollocks", "Go away", "Beat it!", "Ya make me gag", "Bugger off",
"Make me sandwich", "You suck", "Ya' Puke", "Bloody hell!", "Stroke me",
"Bend over", "Get bent", "Tickle my arse", "Ya bag o' shite", "Ya wanker",
"You'll do", "Ya smell bad", "Bag yer head!", "Grab yer ankles", "Bite me",
"Kiss my ring", "Lick my boot", "Pull my finger", "Sniff my finger", "Sod off"
};
String lastArray[16] = {"Need more abuse!", "Your still here?", "Feel lucky punk?", "Momma's calling!",
"Who's yer Daddy?", "Don't cry now!!", "You asked for it", "Butt hurt yet!?",
"Tears are salty?", "Had enough! no!?", "Lose something?", "Don't go!",
"Don't be a bitch", "Don't be a dick!", "Why you shaking?", "Dont shit y'self"
};
void setup() {
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(buttonPin1, INPUT_PULLUP); // sets the internal pull up resistor, unpressed is 1 (HIGH)
pinMode(buttonPin2, INPUT_PULLUP);
pinMode(buttonPin3, INPUT_PULLUP);
pinMode(volts_OK_led, OUTPUT);
pinMode(volts_LOW_led, OUTPUT);
/* if analog input pin (pin number) is unconnected, random analog noise will cause the call to randomSeed() to generate
different seed numbers each time the sketch runs. randomSeed() will then shuffle the random function.
*/
randomSeed(analogRead(26)); // Pin 26 = ADC0
lcd.init(); // Initialize LCD,
lcd.backlight(); // and turn on the backlight
lcd.createChar(0, Penis); // Create a character
lcd.createChar(1, Pussy); // Create a character
lcd.createChar(2, Finger); // Create a character
lcd.clear(); // Clear the LCD screen:
lcd.print("Oi! Wanker!"); // print starts at first column, first row
lcd.setCursor(0, 1); // set cursor to first column, second row
lcd.print("Press 1 > 2 > 3");
}
void loop() {
// Push button 1
buttonRead1 = digitalRead(buttonPin1); // reads 1 with pull-up
// Button debounce
if (buttonRead1 != oldButtonRead1) {
oldButtonRead1 = buttonRead1;
delay (debounceTime);
if (buttonRead1 == 1) {
digitalWrite(ledPin1, LOW);
}
if (buttonRead1 == 0) { // button pushed, pin goes to ground, reads 0. When released pin returns to 1
digitalWrite(ledPin1, HIGH);
lcd.clear(); // clears the display, removes introduction
lcd.setCursor(0, 0); // set cursor to first column, first row
lcd.print("Oi!!");
delay(1000);
lcd.clear();
randNum1 = random(60); // random number from 0 to 59
lcd.print(wordArray1[randNum1]);
lcd.print(" ");
randNum2 = random(60);
lcd.print(wordArray2[randNum2]);
if (randNum1 == 2 | randNum1 == 5 | randNum1 == 10 | randNum1 == 33 | randNum1 == 38 |
randNum1 == 43 | randNum1 == 49)
{
lcd.setCursor(15, 0); // set cursor to 16th column, first row
lcd.write(0); // Print character 0, Penis
}
if (randNum1 == 15 | randNum1 == 34 | randNum1 == 35 | randNum1 == 39 | randNum1 == 41 |
randNum1 == 46 | randNum1 == 51)
{
lcd.setCursor(15, 0); // set cursor to 16th column, first row
lcd.write(1); // Print character 1, Pussy
}
}
}
// Push button 2
buttonRead2 = digitalRead(buttonPin2); // reads 1 with pull-up
// Button debounce
if (buttonRead2 != oldButtonRead2) {
oldButtonRead2 = buttonRead2;
delay (debounceTime);
if (buttonRead2 == 1) {
digitalWrite(ledPin2, LOW);
}
if (buttonRead2 == 0) { // button pushed, pin goes to ground, reads 0. When released pin returns to 1
digitalWrite(ledPin2, HIGH);
lcd.setCursor(0, 1); // set cursor to first column, second row
randNum3 = random(30); // random number from 0 to 29
lcd.print(phraseArray[randNum3]);
if (randNum3 == 8) {
lcd.setCursor(15, 1); // set cursor to 16th column, second row
lcd.write(2); // Print character 2, Finger
}
}
}
// Push button 3
buttonRead3 = digitalRead(buttonPin3); // reads 1 with pull-up
// Button debounce
if (buttonRead3 != oldButtonRead3) {
oldButtonRead3 = buttonRead3;
delay (debounceTime);
if (buttonRead3 == 1) {
digitalWrite(ledPin3, LOW);
}
if (buttonRead3 == 0) { // button pushed, pin goes to ground, reads 0. When released pin returns to 1
digitalWrite(ledPin3, HIGH);
lcd.clear(); // Clear the LCD screen:
lcd.setCursor(0, 0); // set cursor to first column, first row
randNum4 = random(16); // random number from 0 to 9
lcd.print(lastArray[randNum4]);
lcd.setCursor(0, 1);
lcd.print("Press 1 !!");
}
}
// ADC3 to measure VSYS voltage
adc_reading = analogRead(adcVSYS); // 12-bit = 4096 at 3.24 volts .41
adc_voltage = (adc_reading * 3.24) / 4096.0;
vsys_voltage = adc_voltage * 12;
if (vsys_voltage > 4.9) {
digitalWrite(volts_OK_led, HIGH);
digitalWrite(volts_LOW_led, LOW);
}
else {
digitalWrite(volts_LOW_led, HIGH);
digitalWrite(volts_OK_led, LOW);
}
}