Professional Documents
Culture Documents
h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int lectura=0;
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("Hola mundo");
Serial.begin(9600);
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print("bienvenido");
}
//ALCOHOLIMETRO
#include <EEPROM.h>
const int analogSensor = 0;
const int ledCount = 10;
const int ledSave = 0;
const int pushButtonSave = 12;
const int pushButtonRead = 13;
int
int
int
int
ledPins[] = {2,3,4,5,6,7,8,9,10,11};
buttonSave = 0;
buttonRead = 0;
buttonCount = 0;
void setup() {
//Serial.begin(9600);
pinMode(ledSave, OUTPUT);
pinMode(pushButtonSave, INPUT);
pinMode(pushButtonRead, INPUT);
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
pinMode(ledPins[thisLed], OUTPUT);
}
}
void guardar(int value) {
int temp1 = EEPROM.read(0);
int temp2 = EEPROM.read(1);
EEPROM.write(0, value);
EEPROM.write(1, temp1);
EEPROM.write(2, temp2);
//Serial.println("guardado");
delay(2000);
}
void mostrar() {
while (true) {
buttonRead = digitalRead(pushButtonRead);
if (buttonRead == HIGH) {
if (buttonCount < 3) {