I changed the way the questions are put together by defining a variable leadingBlanks and appending the question on to that back of it. Also I changed several of my integers to bytes and even a few bools. The combined result has freed up a significant amount of memory, down to 69% used from 78% before. Thank you for all your help so far build_1971. Now I have room to add some more questions.
#include <Arduino.h>
#include <U8g2lib.h>
#include <string.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ 16, /* clock=*/ SCL, /* data=*/ SDA);
u8g2_uint_t offset;
u8g2_uint_t width;
byte drawPoint = 12;
byte correctCount = 0;
int responseTimer = 0;
int questionNumber;
String completeMsg;
bool msgComplete = false;
byte buttonTrue = 15;
byte buttonFalse = 13;
byte solenoid = 12;
byte lockout = TX;
long lockoutTime = 30000;
bool locked = false;
bool buttonTrueState = 0;
bool buttonFalseState = 0;
const char *text;
bool ansr;
bool newQuestion = true;
const char *leadingBlanks =" ";
struct question{
const char *question;
bool answer;
} questions [] = {
{"In the animated film Finding Nemo, the protagonist is a clownfish.", true},
{"Sharks are mammals.", false},
{"Sea otters have a favorite rock they use to break open food.", true},
{"The blue whale is the biggest animal to have ever lived.", true},
{"A dog sweats by panting its tongue.", false},
{"The hummingbird egg is the world's smallest bird egg.", true},
{"Pigs roll in the mud because they don’t like being clean.", false},
{"Bats are blind.", false},
{"The largest living frog is the Goliath frog of West Africa.", true},
{"An ant can lift 5,000 times its body weight.", true},
{"When exiting a cave, bats always go in the direction of the wind.", false},
{"Galapagos tortoises sleep up to 16 hours a day.", true},
{"An octopus has seven hearts.", false},
{"The goat is the national animal of Scotland.", false},
{"A monkey was the first non-human to go into space.", false},
{"South Africa has three capital cities.", true},
{"The Atlantic Ocean is the biggest ocean on Earth.", false},
{"Mount Everest is the tallest mountain in the world.", true},
{"The Desert of Death is in California.", false},
{"The total length of the Great Wall of China adds up to 13,171 miles.", true},
{"The two longest rivers in the world are the Mississippi and the Nile.", false},
{"The Chunnel between England and France is 31.5 miles long.", true},
{"Greenland is the largest island in the world.", true},
{"There are more countries in South America than Africa.", false},
{"Alaska has the most active volcanoes of any state in the United States.", true},
{"China has the longest coastline in the world.", false},
{"Vatican City is the smallest country in the world.", true},
{"Venezuela is home to the world’s highest waterfall.", true},
{"The human body has four lungs.", false},
{"Human skin regenerates every week.", false},
{"The average human sneeze can be clocked at 100 miles an hour.", true},
{"Humans lose an average of 75 strands of hair a day.", true},
{"Infants have more bones than adults.", true},
{"The heart is the largest internal organ in the body.", false},
{"Most of the human brain is made of muscle.", false},
{"Taste buds can only be found on the tongue.", false},
{"The human eye can distinguish 10 million different colors.", true},
{"Humans lose more than 80% of heat from their feet.", false},
{"The human body is about 60% water.", true},
{"The most common blood type is 0- negative.", true},
{"Aladdin's character was based on Brad Pitt.", false},
{"It took eight months from start to finish to produce the 1959 Disney film, Sleeping Beauty.", false},
{"Pinocchio was the first animated, full-color Walt Disney feature film.", false},
{"Toy Story was Pixar’s first movie.", true},
{"Dumbo is the shortest Disney film.", true},
{"The Aristocats was the first Disney film to be made after Walt Disney’s death.", true},
{"Pepperoni is the most popular pizza topping in the US.", true},
{"Cheesecake comes from Italy.", false},
{"Pineapples grow on trees.", false},
{"A potato was the first vegetable to be planted on the space shuttle.", true},
{"Hawaiian pizza comes from Canada.", true},
{"French fries originated from France.", false},
{"Pizza was the first food consumed in space.", false},
{"Caesar Salad originates from Italy.", false},
{"Ears of corn have an even number of rows.", true},
{"The names of the mascots for Rice Krispies are Snap, Crackle, & Pop.", true},
{"Vanilla is the world’s most expensive spice.", false},
{"The Chinese New Year is celebrated on the same day every year.", false},
{"Punxsutawney Phil is just a nickname for the famous groundhog.", true},
{"The first St. Patrick’s Day parade in the United States was held in New York City.", false},
{"The tradition of dyeing Easter eggs started in the United States.", false},
{"Only two men signed the Declaration of Independence on July 4, 1776.", true},
{"The U.S. and Canada celebrate Thanksgiving on the same day.", false},
{"There are seven nights in Kwanzaa.", true},
{"Memorial Day has a special set of instructions regarding raising and lowering the U.S. flag.", true},
{"The sport Polo takes up the largest amount of space in terms of land area.", true},
{"Every golf ball has the same number of dimples.", false},
{"Football players started wearing helmets in 1943.", true},
{"Brazil is the only nation to have played in every World Cup finals tournament.", true},
{"World-renowned jeweler Tiffany & Co. is the maker of the Vince Lombardi trophy.", true},
{"There are 30 NFL teams.", false},
{"The New York Marathon is the largest in the world.", true},
{"Three strikes in a row in bowling is called a chicken.", false},
{"An astronaut has played golf on the moon.", true},
{"The Tour de France always finishes in Italy.", false},
{"President George Washington brought macaroni and cheese to the USA.", false},
{"Marvel published its first comic in October 1939.", true},
{"The letter T is the most common in the English Language.", false},
{"People who have chiclephobia are afraid of cats.", false},
{"John Glenn became the oldest astronaut when he traveled to space at the age of 77.", true},
{"All the kings in a standard deck of cards have a mustache.", false},
{"Pepsi was the first soft drink to be enjoyed in outer space.", false},
{"The name of Batman’s butler is Albert.", false},
{"Fortune cookies were invented in China.", false},
{"Henry VIII had eight wives.", false},
{"The letter J is the only letter in the alphabet not included in the periodic table.", true},
{"Every country in the world has a rectangular flag.", false},
{"The official color of the Golden Gate Bridge in California is Tennessee Orange.", false},
{"Dr. Pepper is the oldest soft drink in America.", true},
{"The atomic number for lithium is 17.", false},
{"A cross between a horse and a zebra is called a Hobra.", false},
{"The black box in a plane is black.", false},
{"Alliumphobia is a fear of garlic.", true},
{"X-Files star Gillian Anderson was born in Chicago, Illinois.", true},
{"Prince Harry is taller than Prince William.", false},
{"The star sign Aquarius is represented by a tiger.", false},
{"Meryl Streep has won three Academy Awards.", true},
{"Marrakesh is the capital of Morocco.", false},
{"Idina Menzel sings 'let it go' 21 times in 'Let It Go' from Frozen.", true},
{"Waterloo has the greatest number of tube platforms in London.", true},
{"M&M stands for Mars and Moordale.", false},
{"Gin is typically included in a Long Island Iced Tea.", true},
{"The unicorn is the national animal of Scotland.", true},
{"There are two parts of the body that can't heal themselves.", false},
{"Howard Donald is the oldest member of Take That.", true},
{"The Great Wall of China is longer than the distance between London and Beijing.", true},
{"There are 236 episodes of Friends.", true},
{"A lion's roar can be heard up to eight kilometres away.", true},
{"The river Seine in Paris is longer than the river Thames in London.", true},
{"The Battle Of Hastings took place in 1066.", true},
{"K is worth four points in Scrabble.", false},
{"Australia is wider than the moon.", true},
{"Alexander Fleming discovered penicillin.", true},
{"The small intestine is about three-and-a-half times the length of your body.", true},
{"Venus is the hottest planet in the solar system.", true},
{"Bananas are curved because they grow upwards towards the sun.", true},
{"Friends star Lisa Kudrow was originally cast in Frasier.", true},
{"Goldfish have a two second memory.", false},
{"Hot and cold water sound the same when poured.", false},
{"When the two numbers on opposite sides of a dice are added together it always equals 7.", true},
{"Hippos sweat a red substance.", true},
{"Vitamin C is also known by the chemical name of Ascorbic Acid.", true},
{"The Nobel prize-winning novel ‘The Old Man and the Sea’ was written by the American author John Steinbeck.", false},
{"In theory, it takes over 5,000 helium balloons to lift an average-sized human from the ground.", true},
{"Transylvania is a historical region located in central Romania.", true},
{"Glass is manufactured mainly from processed sand.", true},
{"There are 7 naturally occurring noble gases in the periodic table of elements.", false},
{"The world’s earliest surviving motion-picture film dates back to 1888.", true},
{"Insulin was discovered by physiologist and professor of medicine Nicolae Paulescu.", true},
{"After you drink alcohol, it takes your brain 6 minutes to start reacting to it.", true},
{"Thomas Jefferson was the second president of the U.S.A.", false},
{"Manchester United football club has never won the UEFA Champions League trophy.", false},
{"Mount Fuji is the highest mountain in Japan.", true},
{"Steak contains more protein per ounce than broccoli.", false},
{"Indira Gandhi was the first female Prime Minister of India.", true},
{"The lighter was invented before the match.", true},
{"The oldest educational establishment in the world is the University of Al Quaraouiyine in Morocco.", true},
{"The first football in the world was manufactured from a pig’s bladder.", true},
{"Just like humans, dogs can be left-pawed or right-pawed.", true},
{"Rio de Janeiro is the capital city of Brazil.", false},
{"Although they love to drink it, cats are lactose intolerant to cow’s milk.", true},
{"Grapefruit can cause poisoning if consumed with some prescribed drugs.", true},
{"Except for humans, crows and ravens are the most intelligent creatures in the world.", true},
{"The spiral shapes of sunflowers follow the Fibonacci sequence to maximize sunlight intake.", true},
{"Evita Perón was the first female president of Argentina.", false},
{"A human being can live up to 3 weeks without drinking water.", false},
{"Writer Agatha Christie’s real name is Mary Westmacott.", true},
{"A person’s fingernails and hair continue to grow after they die.", false},
{"The movie 'The Birds' was directed by Steven Spielberg.", false},
{"It is illegal to feed pigeons in the Italian city of Venice.", true},
{"The Quetzalcóatl Pyramid in Mexico is bigger than the Great Egyptian Pyramid of Giza.", true},
{"Human teeth are just as strong as the teeth of a mature shark.", true},
{"The Big Apple is a nickname given to Washington D.C in 1971.", false},
{"Peanuts are legumes, not nuts.", true},
{"Emus cannot fly.", true},
{"Electrons move faster than the speed of light.", false},
{"The Mona Lisa was stolen from the Louvre in 1911.", true},
{"An ISTP personality stands for introverted, sensual, thoughtful, and proactive.", false},
{"Hamilton the musical is the first Broadway show ever written about Hamilton.", false},
{"The percentage of students in the US who have taken loans to get through college is declining.", false},
{"The term inflation refers to a general fall in the prices of most products and services.", false},
{"Almost 30% of Americans are self-employed.", true},
{"There are three rivers in Saudi Arabia.", false},
{"The Great Wall of China is visible from space.", false},
{"The Atlantic Ocean is the warmest ocean in the world.", false},
{"When the Eiffel Tower was unveiled, the Parisian art community hated it.", true},
{"There are more ancient pyramids in Sudan than in Egypt.", true},
{"Gisborne, New Zealand was the first city in the world to enter the new millennium.", true},
{"Dogs can understand up to 250 hand gestures.", true},
{"The Peregrine Falcon is the fastest bird in the world.", true},
{"The granny smith apple originates from Australia.", true},
{"The USA grows the most maize.", true},
{"Electrical conductors have low resistance.", true},
{"Human skeleton consists of 205 bones.", false},
{"Molecules are smaller than electrons.", false},
{"Saturn is the largest planet in the solar system.", false},
{"You cannot cry in space.", true},
{"Thomas Edison was afraid of the dark.", true},
{"Canada is the second-largest country in the world.", true},
{"Mercury is the smallest planet in the solar system.", true},
{"Crocodiles have 8 sweat glands.", false},
{"An object at rest has inertia.", true},
{"Zimbabwe is also known as Rhodesia.", true},
{"French is the official language of Brazil.", false},
{"The hardest natural mineral is diamond.", true},
{"Dogs have 42 teeth.", true},
{"The thalamus is not the largest part of the brain.", true},
{"The largest artery in the human body is the aorta.", true},
{"Omnivores feed only on plants.", false},
{"Zebrafish can suffer from the problem of insomnia.", true},
{"Abraham Lincoln had no middle name.", true},
{"Camels can store water in their humps.", false},
{"The Amazon river has native dolphins.", true},
{"Earthquakes are measured using the Richter scale.", true},
{"Horses can sleep while standing.", true},
{"Wellington is the capital of New Zealand.", true},
{"Russia has 11 time zones.", true},
{"Nassau is the capital city of Bahrain.", false},
{"The construction of the Eiffel tower was completed on March 31, 1887.", false},
{"Melbourne is the capital of Australia.", false},
{"Penicillin was discovered in Vietnam to treat malaria.", false},
{"Broccoli contains more vitamin C than lemons.", true},
{"The skull is the strongest bone in the human body.", false},
{"Google was initially called BackRub.", true},
{"Tomatoes are fruit.", true},
{"Mercury’s atmosphere is made up of carbon dioxide.", false},
{"Depression is the leading cause of disability worldwide.", true},
{"Cleopatra was of Egyptian descent.", false},
{"You can sneeze while asleep.", false},
{"It’s impossible to sneeze with your eyes open.", true},
{"Bananas are technically berries.", true},
{"Scallops can’t see.", false},
{"Your nose produces almost one litre of mucus a day.", true},
{"Coca Cola exists in every country around the world.", false},
{"Spider silk was once used to make guitar strings.", false},
{"Humans share 60 percent of their DNA with bananas.", true},
{"In Tuszyn Poland, Winnie the Pooh is banned from children’s playgrounds.", true},
{"Being scared of clouds is called Coulrophobia.", false},
{"Edward Smith was the name of the captain of Titanic.", true},
{"It takes two weeks for a sloth to digest a single meal.", true},
{"The moving sidewalk was invented in 1893." , true},
{"Compared to a hydrogen atom, a carbon atom is lighter.", false},
{"There are over 2,500 stars on the Hollywood Walk of Fame.", true},
{"Nicolas Cage and Michael Jackson both married the same woman.", true},
{"The mathematical name for the shape of a Pringle is hyperbolic paraboloid.", true},
{"A meter is further than a yard.", true},
{"Walmart sells more bananas than any other item in thier stores.", true},
{"Pennies cost more to make than they are worth.", true},
{"Cheese filled with live maggots is a Mediterranean delicacy.", true},
{"Ancient Romans used to use urine to whiten their teeth.", true},
{"There are 60,000 miles of blood vessels in the human body.", true},
{"Rats cannot laugh.", false},
{"Queen ants can live up to 40 years.", false},
{"The show 'Breaking Bad' was initially rejected by the HBO, Showtime, and FX networks.", true},
{"In terms of surface area, Russia is larger than Pluto.", true},
{"OJ Simpson's father was transgender.", false},
{"30% of the bones in the human body are in the feet.", false},
{"Paul is acutally the middle name of Sir Paul McCartney.", true},
{"Mickey Mouse's middle name is Fauntleroy.", false},
{"Sesame Street character Elmo once testified before Congress.", true},
{"Slugs have green blood because of a high magnesium content.", false},
{"J.K. Rowling is the first author to become a billionare.", true},
{"Kingston is the capital of Jamaica.", true},
{"Christian Bale based his character for the film 'American Psycho' on actor Tom Cruise.", true},
{"A hendecagon is a shape with 11 sides.", true},
{"An otter's home is called a lodge.", false},
{"Nutella was invented in 1964 during an international shortage of cocoa.", true},
{"Eight out of the ten tallest mountains in the world are in the country of Nepal.", true},
{"Venus was the first planet to be discovered via telescope.", false},
{"Dead people can not get goose bumps.", false},
{"Ostriches stick their heads in the sand when they feel threatened.", false},
{"The state sport of Maryland is jousting.", true},
{"Lightning never strikes in the same place twice.", false},
{"The capital of Libya is Benghazi.", true},
{"Albert Einstein was awarded the Nobel Prize in Literature.", false},
{"Baby koalas are called joeys.", false},
{"Humans can distinguish between over a trillion different smells.", true},
{"The Spanish national anthem has no words.", true},
{"The first name of Kramer in Seinfeld is Cosmo.", true},
{"It would take 1,200,000 mosquitoes, each sucking once, to completely drain the average human of blood.", true},
{"It can take a photon 40,000 years to travel from the core of the sun to the surface.", true},
{"There are more possible iterations of a game of chess than there are atoms in the known universe.", true},
{"A right triangle can never be equilateral.", true},
{"The Ford Edsel was named after Henry Ford’s father.", false},
{"The Bill of Rights contains 10 amendments to the Constitution.", true},
{"Vaccines cause autism.", false},
{"The name Sylvia Plath was a pseudonym.", false},
{"There are more cells of bacteria in your body than there are human cells.", true},
{"Birds are dinosaurs.", true},
{"Buzz Aldrin was the first man to urinate on the moon.", true},
{"Twinkies have an infinite shelf life.", false},
{"Humans can’t breathe and swallow at the same time.", true},
{"Vitamin C stops you from getting a cold.", false},
{"It's possible to get sick or even die from drinking too much water.", true},
{"Lobster blood is colorless until it is exposed to air.", true},
{"Goldfish eyes perceive not only the visible spectrum but also infrared and ultraviolet light.", true},
{"If you exposed a glass of water to space, it would boil rather than freeze.", true},
{"A fresh egg will float in freshwater, a stale egg will sink.", false},
{"Sound travels 4.3 times faster in water than in air.", true},
{"About 78% of the average human brain consists of water.", true},
{"Macadamia nuts are not toxic to dogs.", false},
{"A lightning strike can reach a temperature of 30,000 degrees Celsius or 54,000 degrees Fahrenheit.", true},
{"Fire typically spreads downhill more quickly than uphill.", false},
{"Frogs don't need to drink water since they can absorb it through their skin.", true},
{"Humans have waterproofing proteins in their skin to help prevent water loss.", true},
{"Urine fluoresces or glows under ultraviolet light.", true},
{"Pearls, bones, and teeth will dissolve in vinegar, which contains weak acetic acid.", true},
{"The chemical name for water is dihydrogen monoxide.", true},
{"The ethylene gas produced by a ripening apple ripens other apples as well as many other types of produce.", true},
{"Water expands about 19% when it freezes into ice.", false},
{"It's possible for hot water to freeze more quickly than cold water.", true},
{"A soccer ball is made up of 32 leather panels, held together by 642 stitches.", true},
{"There is only one even prime number.", true},
{"The square root of two is called Pythagoras' Constant.", true},
{"Zero is the only number that can't be represented in Roman numerals.", true},
{"Broccoli is actually a flower.", true},
{"Several centuries ago in Holland, tulips were more valuable than gold.", true},
{"A person burns more calories when they are asleep than when they watch TV.", true},
{"The path of a light ray can be bent as it travels past a massive object.", true},
{"The wavelength of red light is shorter than that of blue light.", false},
{"A rubber band stores potential energy when stretched.", true},
{"Human skin cells divide only once.", false},
{"Earth’s oldest known rock is about 4 billion years old.", true},
{"An elephant has 100 muscles in its trunk.", false},
{"Water is the most common element on Earth.", false},
{"Electrical energy can be transmitted wirelessly.", true},
{"There are stars made of diamonds.", true},
{"Iron is the most abundant metal in Earth’s crust.", false},
{"Walking up stairs uses more energy than walking on level ground.", true},
{"There are 500 stars visible to the naked eye from Earth.", false},
{"The speed of sound is constant.", false},
{"The plants dinosaurs ate do not exist today.", false},
{"Helium gives off a pungent odor.", false},
{"Hair helps us humans hear.", true},
{"Snowmelt is the source of most of the world’s drinking water.", false},
{"In the human body, food energy is stored in the hair.", false},
{"Galaxies are classified by their shape.", true},
{"Silver is the most conductive of metals.", true},
{"There are more than 2,000 kinds of mosquitoes.", true},
{"Apes cannot laugh.", false},
{"A heptagon has nine sides.", false},
{"The star sign Capricorn is represented by a goat.", true},
{"Seahorses have no teeth or stomach.", true},
{"Nepal is the only country in the world which does not have a rectangular flag.", true},
{"Last Christmas by Wham! reached number one during the 1984 festive season.", false},
{"The oldest wooden wheel still in existence is over 5000 years old.", true},
{"The majority of household dust is made of dirt.", false},
{"The smallest mammal in the world is the bumblebee bat weighing just 0.05 ounces.", true},
{"On a typical world map, Africa touches all four quadrants of the globe.", true},
{"The cornea of the eye houses more blood vessels than your fingers.", false},
{"The first fully animated feature film was created in Argentina.", true},
{"German chocolate cake was invented in Belgium.", false},
{"Actress Marla Gibbs who played Florence on The Jeffersons continued working as a flight attendant during the first 2 years of the show.", true},
{"The Phillipines consists of over 7000 islands.", true},
{"The Trans-Siberian Railway crosses ten different time zones.", false},
{"Producers of The Golden Girls wanted to use the song Friends by Bette Midler as the theme for the show.", true},
{"Cleveland, Ohio was once the third largest city in America.", false},
{"Less than 1 percent of the world's water is fresh water.", false},
{"The brand name SPAM is named as a conjunction of 'spice' and 'ham'.", true},
{"It takes 100 days for a drop of water to travel the entire Mississippi river.", false},
{"In the 19th century arsenic was consumed to promote clear skin.", true},
{"The first person ever processed at Ellis Island was a 15 year old girl from Ireland.", true},
{"Japan has one vending machine for every 25 people.", false},
{"The first time the word 'period' was used on TV in reference to menstruation was in 1985.", true},
{"McDonald's once developed a broccoli flavored chewing gum.", true},
{"There is a tropical fungus that can grow in the brain of a snake and cause the snake to eat itself.", false},
{"Oranges are a hybrid of the mandarin and the pomelo.", true},
{"Q is the only letter that does not appear in the name of any US state.", true},
{"The apple seeds planted by Johnny Appleseed were actually bitter apples for use in the production of hard cider.", true},
{"Scotland has over 500 words for snow.", false},
{"Samsung tests the durability of thier phones by crushing them with a robot shaped like a human butt.", true},
{"Chicago is nicknamed The Windy City because of its weather.", false},
{"Kleenex tissue was originally invented for use in gas mask filters.", true},
{"The small pocket in your jeans was created just for loose change.", false},
{"Only one quarter of the Sahara Desert is sandy.", true},
{"A giraffe's tongue can grow to over 36 inches in length.", false},
{"The inventor of the microwave oven received $46,500 in 1945 when he sold the invention to The American Appliance Company.", false},
{"The summer heat in France can cause the Eiffel Tower to grow as much as 6 inches due to thermal expansion.", true},
{"Medical errors are the third leading cause of death in the US.", true},
{"Giraffes have more neck bones than any other animal.", false},
{"In ancient Egypt it was common practice to place a dead mouse in one's mouth to alleviate a toothache.", true},
{"In the 19th century paint was commonly stored in a pig's bladder.", true},
{"Abraham Lincoln was a licensed bartender.", true},
{"Baseball umpires have are issued undergarments they must wear to officiate a game.", false},
{"The man who discovered penicilin originally called the compound 'mold juice'.", true},
{"Nikola Tesla once sent his secretary home for wearing pearls to work.", true},
{"Bananas will glow red under black light.", false},
{"Tapeworms can grow to as long as 80 feet in length.", true},
{"Ketchup was sold as medicine in the 1830s.", true},
{"The time required for any mammal to defacate is proportional to the mammal's weight.", false},
{"Miami is the only major US city to be founded by a woman.", true},
{"Lemmings will often follow eachother off a cliff to thier deaths.", false},
{"Woodpeckers wrap their tongues around their brain to protect them during pecks.", true},
{"Lightning strikes kill more people per year than shark attacks.", false},
{"Roughly 90% of people struck by lightning survive.", true},
{"In Singapore, anyone caught chewing, importing, or selling gum could face a fine or jail time.", true},
{"Crows are unable to distinguish the differences between human faces.", false},
{"Pigs sweat more than any other farm animal.", false},
{"A blue whale's tongue weighs more than most elephants.", true},
{"Every wife of Tom Cruise has divorced him at the age of 38.", false},
{"Raw pistachios have been known to spontaneously combust when stored in large quantities.", true},
{"Owls are able to move thier eyes in thier sockets further than any other bird.", false},
{"Jennifer Lawrence learned how to skin a squirrel for her role in Winter's Bone.", true},
{"The first college football game was played on Nov. 6, 1869, between Stockton and Princeton.", false},
{"Flamingos can only eat when their heads are upside down.", true},
{"Pound cake got its name because the original recipe called for the dough to be forcefully pressed several times before baking.", false},
{"Madonna was once fired from a Dunkin' Donuts for squirting jelly on a customer.", true},
{"Walt Disney's favorite cartoon character was Goofy.", false},
{"Thailand holds an annual Monkey Buffet Festival where an excess of 3000 monkeys are fed 4.5 tons of fruit.", true},
{"Shakira was a star student in high school choir.", false},
{"Dr. Seuss wrote Green Eggs and Ham to win a bet.", true},
{"More twins are born per capita in Malaysia than any other country.", false},
{"Paul Newman taught Jake Gyllenhaal how to drive.", true},
{"The first text message ever sent read, 'Hello world!'", false},
{"In 1953 Swanson invented the TV dinner becuase of a surplus of frozen Thanksgiving turkeys.", true},
{"The first song to sell 1 million digital copies was Barbie Girl by Aqua.", false},
{"The word 'meme' was coined in Richard Dawkins' 1976 book The Selfish Gene.", true},
{"The first book ever sold on Amazon was The Horse Whisperer by Nicholas Evans.", false},
{"McDonald's created Chicken McNuggets as a healthy menu option in the 1970's.", true},
{"Popcorn was first served in movie theaters in 1923.", false},
{"The first Disney Channel Original Movie was 1997's Northern Lights, starring Diane Keaton.", true},
{"Lightning strikes earth approximately 240 times per second.", false},
{"Mars makes a continuous humming sound.", true},
{"Bats communicate with each other by scratching surfaces that make various noises.", false},
{"The Great Barrier Reef has some sections of reef taller than the Empire State Building.", true},
{"Some tropical songbirds only reproduce during a drought.", false},
{"After sea turtles lay eggs, they create decoy nests to fool predators.", true},
{"Pope Urban VIII tried to ban coughing in the 17th century.", false},
{"There are 293 ways to make change for a dollar.", true},
{"A dime has 122 ridges on the outside edge.", false},
{"The first Pokemon to be created was Rhydon.", true},
{"The dot over a lower case 'i' is called a tilte.", false},
{"X-rays cannot penetrate diamond.", true}
// 413 questions
};
void setup(void) {
u8g2.begin();
u8g2.setFontMode(0); // enable transparent mode, which is faster
pinMode(buttonTrue, INPUT);
pinMode(buttonFalse, INPUT);
pinMode(solenoid, OUTPUT);
pinMode(lockout, OUTPUT);
randomSeed(random(0,65535));
hello();
}
void loop(void) {
u8g2_uint_t x;
u8g2.firstPage();
digitalWrite(lockout, HIGH);
do {
if (newQuestion == true) {
getQuestionNumber();
msgComplete = false;
completeMsg ="";
}
x = offset;
// draw the scrolling text at current offset
buttonTrueState = digitalRead(buttonTrue);
buttonFalseState = digitalRead(buttonFalse);
if (buttonTrueState == LOW and buttonFalseState == HIGH) {
u8g2.setFont(u8g2_font_luRS12_tf);
if (msgComplete == false) {
completeMsg.concat(leadingBlanks);
completeMsg.concat(questions[questionNumber].question);
text = completeMsg.c_str();
msgComplete = true;
}
ansr = questions[questionNumber].answer;
width = u8g2.getUTF8Width(text); // calculate the pixel width of the text
drawPoint = 12;
}
else if (buttonTrueState == HIGH and ansr == true) {
correctAnswer();
}
else if (buttonFalseState == LOW and ansr == false) {
correctAnswer();
}
else if (buttonTrueState == HIGH and ansr == false) {
incorrectAnswer();
}
else if (buttonFalseState == LOW and ansr == true) {
incorrectAnswer();
}
else if (buttonTrueState == HIGH and buttonFalseState == LOW) {
invalidAnswer();
}
if (correctCount == 7) {
unlockSolenoid();
u8g2.clear();
ESP.deepSleep(0);
}
digitalWrite(solenoid, LOW);
do { // repeated drawing of the scrolling text...
u8g2.drawUTF8(x, drawPoint, text); // draw the scolling text
x += width;
} while ( x < u8g2.getDisplayWidth() ); // draw again until the complete display is filled
if (drawPoint == 12) {
u8g2.setFont(u8g2_font_luRS12_tf); // draw the current pixel width
u8g2.setCursor(0, 32);
u8g2.print("True or False"); // this value must be lesser than 128 unless U8G2_16BIT is set
}
} while ( u8g2.nextPage() );
offset -= 1; // scroll by one pixel
if ( (u8g2_uint_t)offset < (u8g2_uint_t) - width )
offset = 0;
responseTimer ++;
if (responseTimer == 6000) {
responseTimer = 0;
u8g2.clear();
digitalWrite(lockout, HIGH);
ESP.deepSleep(0);
}
}
void hello(void) {
u8g2.clear();
u8g2.firstPage();
u8g2.setFont(u8g2_font_logisoso32_tf);
u8g2.setCursor(0, 32);
u8g2.print("Hello.");
u8g2.nextPage();
delay(3000);
}
void correctAnswer(void) {
u8g2.clear();
u8g2.firstPage();
u8g2.setFont(u8g2_font_logisoso28_tf);
u8g2.setCursor(0, 30);
u8g2.print("Correct.");
u8g2.nextPage();
delay(3000);
correctCount ++;
responseTimer = 0;
newQuestion = true;
offset = 0;
}
void incorrectAnswer(void) {
u8g2.clear();
u8g2.firstPage();
u8g2.setFont(u8g2_font_logisoso22_tf);
u8g2.setCursor(0, 27);
digitalWrite(lockout, LOW);
u8g2.print("Incorrect.");
u8g2.nextPage();
delay(3000);
u8g2.clear();
delay(lockoutTime);
correctCount = 0;
responseTimer = 0;
newQuestion = true;
lockoutTime = lockoutTime * 2;
offset = 0;
}
void invalidAnswer(void) {
u8g2.clear();
u8g2.firstPage();
u8g2.setFont(u8g2_font_logisoso18_tf);
u8g2.setCursor(0, 25);
u8g2.print("Invalid response.");
u8g2.nextPage();
delay(3000);
correctCount = 0;
responseTimer = 0;
newQuestion = true;
offset = 0;
}
void unlockSolenoid(void) {
digitalWrite(solenoid, HIGH);
u8g2.clear();
u8g2.firstPage();
u8g2.setFont(u8g2_font_logisoso22_tf);
u8g2.setCursor(0, 27);
u8g2.print("Unlocked.");
u8g2.nextPage();
delay(30000);
correctCount = 0;
responseTimer = 0;
lockoutTime = 30000;
newQuestion = true;
}
void getQuestionNumber(void) {
questionNumber = random(0,413);
newQuestion = false;
}