Tell us about yourself!

Complete Your Profile
  • TaranA3 commented on 1232443's instructable Arduino LCD!6 weeks ago
    Arduino LCD!

    I cant get the keypad test to work#define DFR_LCD_KEYPAD_KEY_PIN A0int buttonState = 0; // current state of the buttonint lastButtonState = 0; // previous state of the button#include <DFR_LCD_Keypad.h>int lcd;int diceOne;int diceTwo;#define KEY_SELECT; uint8_t read_key(void);void backlight_on (void);void setup() { // initialize the button pin as a input: lcd.begin(16, 2); lcd.setCursor(1, 0); lcd.print("Roll the dice!");}void loop() { if (KEY_SELECT) == HIGH { // if the current state is HIGH then the button went from off to on: diceOne = random(1, 7); diceTwo = random(1, 7); //read the pushbutton input pin: buttonState = analogRead(buttonPin); // compare the buttonState to its previous state if (buttonState != lastButtonState) { // if the state has changed...

    see more »

    I cant get the keypad test to work#define DFR_LCD_KEYPAD_KEY_PIN A0int buttonState = 0; // current state of the buttonint lastButtonState = 0; // previous state of the button#include <DFR_LCD_Keypad.h>int lcd;int diceOne;int diceTwo;#define KEY_SELECT; uint8_t read_key(void);void backlight_on (void);void setup() { // initialize the button pin as a input: lcd.begin(16, 2); lcd.setCursor(1, 0); lcd.print("Roll the dice!");}void loop() { if (KEY_SELECT) == HIGH { // if the current state is HIGH then the button went from off to on: diceOne = random(1, 7); diceTwo = random(1, 7); //read the pushbutton input pin: buttonState = analogRead(buttonPin); // compare the buttonState to its previous state if (buttonState != lastButtonState) { // if the state has changed, increment the counter }}}Arduino: 1.8.6 (Windows 10), TD: 1.44, Board: "Arduino/Genuino Uno"C:\Users\taran\Documents\Arduino\dice_for_catan\dice_for_catan.ino:8:19: warning: ISO C++11 requires whitespace after the macro name #define KEY_SELECT; ^C:\Users\taran\Documents\Arduino\dice_for_catan\dice_for_catan.ino:8:0: warning: "KEY_SELECT" redefined #define KEY_SELECT; ^In file included from C:\Users\taran\Documents\Arduino\dice_for_catan\dice_for_catan.ino:4:0:C:\Users\taran\Documents\Arduino\libraries\DFR_LCD_Keypad/DFR_LCD_Keypad.h:55:0: note: this is the location of the previous definition #define KEY_SELECT DFR_LCD_KEYPAD_KEY_SELECT ^C:\Users\taran\Documents\Arduino\dice_for_catan\dice_for_catan.ino: In function 'void setup()':dice_for_catan:17:7: error: request for member 'begin' in 'lcd', which is of non-class type 'int' lcd.begin(16, 2); ^dice_for_catan:18:7: error: request for member 'setCursor' in 'lcd', which is of non-class type 'int' lcd.setCursor(1, 0); ^dice_for_catan:19:7: error: request for member 'print' in 'lcd', which is of non-class type 'int' lcd.print("Roll the dice!"); ^C:\Users\taran\Documents\Arduino\dice_for_catan\dice_for_catan.ino: In function 'void loop()':dice_for_catan:8:19: error: expected primary-expression before ';' token #define KEY_SELECT; ^C:\Users\taran\Documents\Arduino\dice_for_catan\dice_for_catan.ino:23:7: note: in expansion of macro 'KEY_SELECT' if (KEY_SELECT) == HIGH { ^dice_for_catan:8:19: error: expected ')' before ';' token #define KEY_SELECT; ^C:\Users\taran\Documents\Arduino\dice_for_catan\dice_for_catan.ino:23:7: note: in expansion of macro 'KEY_SELECT' if (KEY_SELECT) == HIGH { ^dice_for_catan:23:17: error: expected primary-expression before ')' token if (KEY_SELECT) == HIGH { ^exit status 1request for member 'begin' in 'lcd', which is of non-class type 'int'This report would have more information with"Show verbose output during compilation"option enabled in File -> Preferences.I keep getting plz help

    View Instructable »
  • Control an RGB LED Matrix With Android and IOIO

    Can I use the app with the NodeMCU and if I can do I just need to connect the NodeMCU to wifi and hook it up as a input on a Arduino Uno?

    View Instructable »
  • TaranA3 commented on robmawe91's instructable Arduino LCD Keypad Shield8 weeks ago
    Arduino LCD Keypad Shield

    I downloaded your sketch but when I tried to compile it I got the following error messages:Arduino: 1.8.6 (Windows 10), Board: "Arduino/Genuino Uno"FINA14KITKJE85T:6:1: error: 'DFR_LCD_Keypad' does not name a type DFR_LCD_Keypad keypad(A0, &lcd); ^C:\Users\taran\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino:7:11: warning: uninitialized const 'KEY_RIGHT' [-fpermissive] const int KEY_RIGHT; ^FINA14KITKJE85T:8:19: error: expected initializer before ':' token const int KEY_LEFT: ^C:\Users\taran\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino:10:11: warning: uninitialized const 'KEY_DOWN' [-fpermissive] const int KEY_DOWN; ^C:\Users\taran\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino:11:11: warning: uninitialized const 'KEY_NONE' [-fpermissiv...

    see more »

    I downloaded your sketch but when I tried to compile it I got the following error messages:Arduino: 1.8.6 (Windows 10), Board: "Arduino/Genuino Uno"FINA14KITKJE85T:6:1: error: 'DFR_LCD_Keypad' does not name a type DFR_LCD_Keypad keypad(A0, &lcd); ^C:\Users\taran\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino:7:11: warning: uninitialized const 'KEY_RIGHT' [-fpermissive] const int KEY_RIGHT; ^FINA14KITKJE85T:8:19: error: expected initializer before ':' token const int KEY_LEFT: ^C:\Users\taran\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino:10:11: warning: uninitialized const 'KEY_DOWN' [-fpermissive] const int KEY_DOWN; ^C:\Users\taran\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino:11:11: warning: uninitialized const 'KEY_NONE' [-fpermissive] const int KEY_NONE; ^C:\Users\taran\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino: In function 'void setup()':FINA14KITKJE85T:22:11: error: 'led' was not declared in this scope pinMode(led, OUTPUT); ^C:\Users\taran\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino: In function 'void loop()':FINA14KITKJE85T:29:14: error: 'keypad' was not declared in this scope last_key = keypad.get_last_key(); ^FINA14KITKJE85T:39:12: error: the value of 'KEY_RIGHT' is not usable in a constant expression case KEY_RIGHT: ^C:\Users\taran\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino:7:11: note: 'KEY_RIGHT' was not initialized with a constant expression const int KEY_RIGHT; ^FINA14KITKJE85T:39:12: error: the value of 'KEY_RIGHT' is not usable in a constant expression case KEY_RIGHT: ^C:\Users\taran\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino:7:11: note: 'KEY_RIGHT' was not initialized with a constant expression const int KEY_RIGHT; ^FINA14KITKJE85T:43:12: error: 'KEY_UP' was not declared in this scope case KEY_UP: ^FINA14KITKJE85T:47:12: error: the value of 'KEY_DOWN' is not usable in a constant expression case KEY_DOWN: ^C:\Users\taran\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino:10:11: note: 'KEY_DOWN' was not initialized with a constant expression const int KEY_DOWN; ^FINA14KITKJE85T:47:12: error: the value of 'KEY_DOWN' is not usable in a constant expression case KEY_DOWN: ^C:\Users\taran\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino:10:11: note: 'KEY_DOWN' was not initialized with a constant expression const int KEY_DOWN; ^FINA14KITKJE85T:51:12: error: 'KEY_LEFT' was not declared in this scope case KEY_LEFT: ^FINA14KITKJE85T:55:12: error: 'KEY_SELECT' was not declared in this scope case KEY_SELECT: ^FINA14KITKJE85T:61:12: error: the value of 'KEY_NONE' is not usable in a constant expression case KEY_NONE: ^C:\Users\taran\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino:11:11: note: 'KEY_NONE' was not initialized with a constant expression const int KEY_NONE; ^FINA14KITKJE85T:61:12: error: the value of 'KEY_NONE' is not usable in a constant expression case KEY_NONE: ^C:\Users\taran\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino:11:11: note: 'KEY_NONE' was not initialized with a constant expression const int KEY_NONE; ^exit status 1'DFR_LCD_Keypad' does not name a typeInvalid library found in C:\Users\taran\Documents\Arduino\libraries\keypad_values: C:\Users\taran\Documents\Arduino\libraries\keypad_valuesInvalid library found in C:\Users\taran\Documents\Arduino\libraries\Yahzee: C:\Users\taran\Documents\Arduino\libraries\YahzeeThis report would have more information with"Show verbose output during compilation"option enabled in File -> Preferences.

    View Instructable »
  • How to Add WiFi Control to Any Project || ESP32 Beginner's Guide

    can you make the data pin from the esp32/esp8266 any pin you want and could i have the 32x32 led matrix hooked up to a arduino pro mini to power the led matrix and have the esp8266 send images from my phone to the led matrix?

    View Instructable »
  • TaranA3 commented on Pjtheman's instructable Bubba Gump Battery Swap2 months ago
    Bubba Gump Battery Swap

    How do you take the batteries out and how do you put it together (what goes where?)

    View Instructable »
  • TaranA3 commented on GreatScottLab's instructable Make Your Own FM Radio2 months ago
    Make Your Own FM Radio

    Hello?

    i would like to see a build video on building a radio using 1 pcs TDA1905 5W Audio Amplifier with Muting IC New DIP ST, • Digital Potentiometer - 10K, Audio Jack 3.5mm, ELEGOO 17 Values 1% Resistor Kit Assortment, 0 Ohm-1M Ohm (Pack of 525),Ceramic Capacitor Assortment Kit - Set of 600 Small Assorted Capacitors from 100 nF to 10 uF in a Box - Non-Polarized Disc Capacitor Component Set from Plusivo, Electrolytic Capacitor Assorted Assortment Box Kit,500PCS,Pair 62.5cm 4 Section Telescopic Stainless Steel AM FM Radio Antenna, microtivity IL612 5mm Diffused RGB Controllable LED, Common Anode (Pack of 12),MicroSD card module for Arduino and a Breadboard - Mini and the audio jack is used for when you want to listen to the radio via speaker

    View Instructable »
  • TaranA3 commented on Floje's instructable DIY FM Radio2 months ago
    DIY FM Radio

    i like it but i would like to see a build video using 1 pcs TDA1905 5W Audio Amplifier with Muting IC New DIP ST, • Digital Potentiometer - 10K, Audio Jack 3.5mm, ELEGOO 17 Values 1% Resistor Kit Assortment, 0 Ohm-1M Ohm (Pack of 525),Ceramic Capacitor Assortment Kit - Set of 600 Small Assorted Capacitors from 100 nF to 10 uF in a Box - Non-Polarized Disc Capacitor Component Set from Plusivo, Electrolytic Capacitor Assorted Assortment Box Kit,500PCS,Pair 62.5cm 4 Section Telescopic Stainless Steel AM FM Radio Antenna, microtivity IL612 5mm Diffused RGB Controllable LED, Common Anode (Pack of 12),MicroSD card module for Arduino and a Breadboard - Mini Modular (White) and put it in the same case as the Make your own FM Radio - Part 2 and using a case (like in DIY RADIO by greatscott- part 2)

    View Instructable »
  • TaranA3 commented on lonesoulsurfer's instructable Electronic Cricket Game2 months ago
    Electronic Cricket  Game

    then if there both the same, why whould you need 555 timer IC and a 555 IC, couldn't you make it with 2 of the same things?

    what do theSPST PUSH BUTTON SWITCH "RED" MOMENTARY-ON NORMALLY OPEN, square button on top and NEW 12PCS Push Button Momentary Panel Mount Switch Knob Small Mini N/O 6 Color do on the game?

    View Instructable »
  • TaranA3 commented on lonesoulsurfer's instructable Electronic Cricket Game2 months ago
    Electronic Cricket  Game

    will the uxcell 2 Pcs ON/Off Switch 2 Wires Covered Battery Holder Case for 9V Battery do for this project? would i turn off the game and not the battery?

    whats the difference between the 555 Timer IC and the 555 IC?

    can you suggest cases for the game?

    is there a video on putting it together?

    View Instructable »
  • TaranA3 commented on nikhilraghava's instructable ESP8266 Weather Server2 months ago
    ESP8266 Weather Server

    can i print the data to a lcd screen?

    View Instructable »
  • Raspberry Pi: Wall Mounted Calendar and Notification Center

    can you create a new event on the calander?

    the link http://lifehacker.com/the-coolest-things-you-can-a... dosn't open, https://cdn.instructables.com/ORIG/F56/WZI1/IIXF7U... and https://cdn.instructables.com/ORIG/F29/HE08/IJRFH6... does not open when downloaded and is there a video on putting it together?

    View Instructable »
  • TaranA3 commented on Pjtheman's instructable Bubba Gump Battery Swap2 months ago
    Bubba Gump Battery Swap

    does it mean that the battery is dead when there is a solid red light (does not go out)

    View Instructable »
  • TaranA3 commented on Pjtheman's instructable Bubba Gump Battery Swap2 months ago
    Bubba Gump Battery Swap

    is it the same process with the plastic ones?

    View Instructable »
  • Arduino Controlled Versatile Timer/controller

    you should code it so that its an actual timer

    View Instructable »
  • TaranA3 commented on GreatScottLab's instructable Make Your Own FM Radio3 months ago
    Make Your Own FM Radio

    and how do you hook up the Digital Potentiometer? like what connect to what

    how meny volts does the radio need to operate?

    is there a PAM8403 Super Mini Digital Amplifier Board 2 * 3W Class D Digital 2.5V To 5V Power Amplifier Board Efficient with pins already attached?

    View Instructable »
  • TaranA3 commented on witnessmenow's instructable RGB LED Matrix With an ESP8266 3 months ago
    RGB LED Matrix With an ESP8266

    Will the wire setup work with a esp8266?

    View Instructable »
  • TaranA3 commented on witnessmenow's instructable RGB LED Matrix With an ESP8266 3 months ago
    RGB LED Matrix With an ESP8266

    could you use a esp8266 with a 32x32 RGB LED Matrix Panel - 4mm Pitch?

    View Instructable »
  • TaranA3 commented on justinzing7's instructable LED Sunrise Alarm Clock4 months ago
    LED Sunrise Alarm Clock

    will the RTClib.h library work with the DS3231 RTC module, How many ports do you need? (Like the number of each ports), would i just change to 24 to 12 in this code #define TIME_24_HOUR true to get to a 12hr format and will any led strip work ( like even the LED Rope Light Wifi Controller Waterproof RGB Color Changing 16.4ft 150leds SMD 5050 Strip Lights Kit work with Alexa?

    View Instructable »
  • TaranA3 commented on justinzing7's instructable LED Sunrise Alarm Clock6 months ago
    LED Sunrise Alarm Clock

    what do the Caps, several 1uF, 10uF for LEDs look like?

    View Instructable »
  • TaranA3 followed GreatScottLab7 months ago
      • Make Your Own Sensored ESC
      • DIY Digital Spirit Level
      • DIY Peristaltic Pump
  • Arduino: Electronic Dice (using Random Numbers)

    I am making a digital dice using a lcd shield, how would i code to make the dice roll when i press the select button

    View Instructable »
  • TaranA3 commented on justinzing7's instructable LED Sunrise Alarm Clock7 months ago
    LED Sunrise Alarm Clock

    is there a video on putting it all together?

    If anyone is building one just using the Arduino, can they plz record them building it and post it to youtube?

    and is the coding the same if you use just the Arduino?

    and I want to put a socket for a bed viberator on there, how would I do it? would I have to hook the motor to power and how would I code it so that it activates the viberator when the alarm goes off in the morning?

    View Instructable »
  • TaranA3 commented on deba168's instructable DIY Acrylic RGB LED Sign7 months ago
    DIY Acrylic RGB LED Sign

    could I make the bottom out of wood and if I can what are the dimentions to get for the wood?

    View Instructable »
  • TaranA3 commented on justinzing7's instructable LED Sunrise Alarm Clock7 months ago
    LED Sunrise Alarm Clock

    can you make it without the magnet?

    can you plz provide me the link to the PCB that you used, I really like that design

    what can I use to make the holder if I don't have access to a 3D printer?

    View Instructable »
  • TaranA3 commented on PaulSS's instructable Arduino Uno Menu Template9 months ago
    Arduino Uno Menu Template

    I need some help, when I go to upload the code to my Arduino, I get Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "Arduino/Genuino Uno"catan_game_menu:7: error: expected '}' before 'int' int readKey; ^catan_game_menu:7: error: expected ',' or ';' before 'int'C:\Users\taran\Downloads\catan_game_menu\catan_game_menu.ino: In function 'void loop()':catan_game_menu:71: error: 'mainMenuDraw' was not declared in this scope mainMenuDraw(); ^catan_game_menu:72: error: 'drawCursor' was not declared in this scope drawCursor(); ^catan_game_menu:73: error: 'operateMainMenu' was not declared in this scope operateMainMenu(); ^C:\Users\taran\Downloads\catan_game_menu\catan_game_menu.ino: In function 'void operateMainMenu()':catan_game_menu:126: error: 'readKey' was not de...

    see more »

    I need some help, when I go to upload the code to my Arduino, I get Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "Arduino/Genuino Uno"catan_game_menu:7: error: expected '}' before 'int' int readKey; ^catan_game_menu:7: error: expected ',' or ';' before 'int'C:\Users\taran\Downloads\catan_game_menu\catan_game_menu.ino: In function 'void loop()':catan_game_menu:71: error: 'mainMenuDraw' was not declared in this scope mainMenuDraw(); ^catan_game_menu:72: error: 'drawCursor' was not declared in this scope drawCursor(); ^catan_game_menu:73: error: 'operateMainMenu' was not declared in this scope operateMainMenu(); ^C:\Users\taran\Downloads\catan_game_menu\catan_game_menu.ino: In function 'void operateMainMenu()':catan_game_menu:126: error: 'readKey' was not declared in this scope readKey = analogRead(0); ^catan_game_menu:131: error: 'evaluateButton' was not declared in this scope button = evaluateButton(readKey); ^catan_game_menu:139: error: 'menuItem1' was not declared in this scope menuItem1(); ^catan_game_menu:142: error: 'menuItem2' was not declared in this scope menuItem2(); ^catan_game_menu:195: error: a function-definition is not allowed here before '{' token int evaluateButton(int x) { ^catan_game_menu:297: error: expected '}' at end of input } ^exit status 1expected '}' before 'int'and my code is String menuItems[] = {"catan", "catan explores and pirates"// Navigation button variablesint readKey;// Menu control variablesint menuPage = 0;int maxMenuPages = round(((sizeof(menuItems) / sizeof(String)) / 2) + .5);int cursorPosition = 0;// Creates 3 custom characters for the menu displaybyte downArrow[8] = { 0b00100, // * 0b00100, // * 0b00100, // * 0b00100, // * 0b00100, // * 0b10101, // * * * 0b01110, // *** 0b00100 // *};byte upArrow[8] = { 0b00100, // * 0b01110, // *** 0b10101, // * * * 0b00100, // * 0b00100, // * 0b00100, // * 0b00100, // * 0b00100 // *};byte menuCursor[8] = { B01000, // * B00100, // * B00010, // * B00001, // * B00010, // * B00100, // * B01000, // * B00000 //};#include <Wire.h>#include <LiquidCrystal.h>// Setting the LCD shields pinsLiquidCrystal lcd(8, 9, 4, 5, 6, 7);void setup() { // Initializes serial communication Serial.begin(9600); // Initializes and clears the LCD screen lcd.begin(16, 2); lcd.clear(); // Creates the byte for the 3 custom characters lcd.createChar(0, menuCursor); lcd.createChar(1, upArrow); lcd.createChar(2, downArrow);}void loop() { mainMenuDraw(); drawCursor(); operateMainMenu();}// This function will generate the 2 menu items that can fit on the screen. They will change as you scroll through your menu. Up and down arrows will indicate your current menu position.void mainMenuDraw() { Serial.print(menuPage); lcd.clear(); lcd.setCursor(1, 0); lcd.print("catan"); lcd.setCursor(1, 1); lcd.print("catan explorers and pirates"); if (menuPage == 0) { lcd.setCursor(15, 1); lcd.write(byte(2)); }}// When called, this function will erase the current cursor and redraw it based on the cursorPosition and menuPage variables.void drawCursor() { for (int x = 0; x < 2; x++) { // Erases current cursor lcd.setCursor(0, x); lcd.print(" "); } // The menu is set up to be progressive (menuPage 0 = Item 1 & Item 2, menuPage 1 = Item 2 & Item 3, menuPage 2 = Item 3 & Item 4), so // in order to determine where the cursor should be you need to see if you are at an odd or even menu page and an odd or even cursor position. if (menuPage % 2 == 0) { if (cursorPosition % 2 == 0) { // If the menu page is even and the cursor position is even that means the cursor should be on line 1 lcd.setCursor(0, 0); lcd.write(byte(0)); } if (cursorPosition % 2 != 0) { // If the menu page is even and the cursor position is odd that means the cursor should be on line 2 lcd.setCursor(0, 1); lcd.write(byte(0)); } } if (menuPage % 2 != 0) { if (cursorPosition % 2 == 0) { // If the menu page is odd and the cursor position is even that means the cursor should be on line 2 lcd.setCursor(0, 1); lcd.write(byte(0)); } if (cursorPosition % 2 != 0) { // If the menu page is odd and the cursor position is odd that means the cursor should be on line 1 lcd.setCursor(0, 0); lcd.write(byte(0)); } }}void operateMainMenu() { int activeButton = 0; while (activeButton == 0) { int button; readKey = analogRead(0); if (readKey < 790) { delay(100); readKey = analogRead(0); } button = evaluateButton(readKey); switch (button) { case 0: // When button returns as 0 there is no action taken break; case 1: // This case will execute if the "forward" button is pressed button = 0; switch (cursorPosition) { // The case that is selected here is dependent on which menu page you are on and where the cursor is. case 0: menuItem1(); break; case 1: menuItem2(); break; activeButton = 1; mainMenuDraw(); drawCursor(); break; case 2: button = 0; if (menuPage == 0) { cursorPosition = cursorPosition - 1; cursorPosition = constrain(cursorPosition, 0, ((sizeof(menuItems) / sizeof(String)) - 1)); } if (menuPage % 2 == 0 and cursorPosition % 2 == 0) { menuPage = menuPage - 1; menuPage = constrain(menuPage, 0, maxMenuPages); } if (menuPage % 2 != 0 and cursorPosition % 2 != 0) { menuPage = menuPage - 1; menuPage = constrain(menuPage, 0, maxMenuPages); } cursorPosition = cursorPosition - 1; cursorPosition = constrain(cursorPosition, 0, ((sizeof(menuItems) / sizeof(String)) - 1)); mainMenuDraw(); drawCursor(); activeButton = 1; break; case 3: button = 0; if (menuPage % 2 == 0 and cursorPosition % 2 != 0) { menuPage = menuPage + 1; menuPage = constrain(menuPage, 0, maxMenuPages); } if (menuPage % 2 != 0 and cursorPosition % 2 == 0) { menuPage = menuPage + 1; menuPage = constrain(menuPage, 0, maxMenuPages); } cursorPosition = cursorPosition + 1; cursorPosition = constrain(cursorPosition, 0, ((sizeof(menuItems) / sizeof(String)) - 1)); mainMenuDraw(); drawCursor(); activeButton = 1; break; } }}// This function is called whenever a button press is evaluated. The LCD shield works by observing a voltage drop across the buttons all hooked up to A0.int evaluateButton(int x) { int result = 0; if (x < 50) { result = 1; // right } else if (x < 195) { result = 2; // up } else if (x < 380) { result = 3; // down } else if (x < 790) { result = 4; // left } return result;}// If there are common usage instructions on more than 1 of your menu items you can call this function from the sub// menus to make things a little more simplified. If you don't have common instructions or verbage on multiple menus// I would just delete this void. You must also delete the drawInstructions()function calls from your sub menu functions.void drawInstructions() { lcd.setCursor(0, 1); // Set cursor to the bottom line lcd.print("Use "); lcd.write(byte(1)); // Up arrow lcd.print("/"); lcd.write(byte(2)); // Down arrow lcd.print(" buttons");}void catan () { // Function executes when you select the 2nd item from main menu int activeButton = 0; lcd.clear(); lcd.setCursor(3, 0); lcd.print(" catan "; buildUp(); lcd.clear(); lcd.setCursor(7, 0); lcd.print(diceOne); lcd.setCursor(7, 1); lcd.print(diceTwo); if (diceOne + diceTwo == 7) { lcd.clear(); lcd.setCursor(7, 0); lcd.print("7"); lcd.setCursor(3, 1); lcd.print("The robber"); } if (diceOne + diceTwo == 5,4,3,2,6 ){ lcd.clear(); lcd.setCursor(7, 0); lcd.print("5,4,3,2,6");} }}void catan explores and pirates () { // Function executes when you select the 2nd item from main menu int activeButton = 0; lcd.clear(); lcd.setCursor(3, 0); lcd.print("catan explores and pirates "); buildUp(); lcd.clear(); lcd.setCursor(7, 0); lcd.print(diceOne); lcd.setCursor(7, 1); lcd.print(diceTwo); if (diceOne + diceTwo == 7) { lcd.clear(); lcd.setCursor(7, 0); lcd.print("7"); lcd.setCursor(3, 1); lcd.print("The pirate"); } if (diceOne + diceTwo == 5,4,3,2,6 ){ lcd.clear(); lcd.setCursor(7, 0); lcd.print("5,4,3,2,6");} if (BUTTON_UP == HIGH) { buildUp(); lcd.clear(); lcd.setCursor(7, 0); lcd.print(diceOne); } if (diceOne == 4, 6, 3, 2) { lcd.clear(); lcd.setCursor(7, 0); lcd.print("4,6,3,2"); lcd.setCursor(3, 1); lcd.print ("fish"); } }}

    View Instructable »