mirror of
https://github.com/KevinMidboe/Arduino.git
synced 2025-10-29 17:40:11 +00:00
Init commit with many years of arduino sketches and projects. I dont know if the esp8266 includes much, but there are also libraries. I hope they dont have crazy automatic versioning through the Arduino IDE.
This commit is contained in:
72
Projects/Tea-duino Main/Menusystem_LCD/Menusystem_LCD.ino
Executable file
72
Projects/Tea-duino Main/Menusystem_LCD/Menusystem_LCD.ino
Executable file
@@ -0,0 +1,72 @@
|
||||
// include the library code:
|
||||
#include <LiquidCrystal.h>
|
||||
|
||||
// initialize the library with the numbers of the interface pins
|
||||
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
|
||||
int UD = 0;
|
||||
int LR = 0;
|
||||
const int buttonPin = 2;
|
||||
|
||||
char* myString [] = {"@EchoEsq", "@SindreIvers", "@KevinMidboe", "@Odinbn", "@hozar132"};
|
||||
int length = 0;
|
||||
|
||||
int buttonState = 0;
|
||||
|
||||
int i = 0;
|
||||
|
||||
void setup(){
|
||||
lcd.begin(16, 2);
|
||||
|
||||
pinMode(buttonPin, INPUT);
|
||||
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
//Get length of myString
|
||||
length = 5;
|
||||
|
||||
UD = analogRead(0);
|
||||
LR = analogRead(1);
|
||||
/*
|
||||
if (UD > 512)
|
||||
{
|
||||
Serial.print("UP");
|
||||
delay(800);
|
||||
}
|
||||
else
|
||||
if (UD < 512)
|
||||
{
|
||||
Serial.print("Down");
|
||||
delay(800);
|
||||
}
|
||||
else
|
||||
if (LR < 512 && UD > 512)
|
||||
{
|
||||
Serial.print("Right");
|
||||
delay(800);
|
||||
}
|
||||
else
|
||||
if (LR < 512)
|
||||
{
|
||||
Serial.print("Left");
|
||||
delay(800);
|
||||
}*/
|
||||
|
||||
buttonState = digitalRead(buttonPin);
|
||||
if (buttonState == HIGH)
|
||||
{
|
||||
lcd.clear();
|
||||
lcd.write(">");
|
||||
lcd.write(myString[i]);
|
||||
lcd.setCursor(1,1);
|
||||
lcd.write(myString[i + 1]);
|
||||
delay(800);
|
||||
i++;
|
||||
}
|
||||
if (i >= length)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user