Last active
August 29, 2015 13:58
-
-
Save adelarcubs/10001701 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <LiquidCrystal.h> | |
const int p1 = 5; | |
const int p2 = 4; | |
LiquidCrystal lcd(13, 12, 5, 4, 3, 2); | |
void setup() { | |
Serial.begin(9600); | |
lcd.begin(16,2); | |
} | |
void loop() { | |
float vlP1 = analogRead(p1); | |
float vlP2 = analogRead(p2); | |
lcd.setCursor(0, 0); | |
lcd.print(vlP1); | |
Serial.print("Potencimetro 1: "); | |
Serial.println(vlP1); | |
lcd.setCursor(8, 0); | |
lcd.print(vlP2); | |
Serial.print("Potencimetro 2: "); | |
Serial.println(vlP2); | |
float valor = vlP1 * vlP2; | |
Serial.print("Calc: "); | |
Serial.println(valor); | |
lcd.setCursor(0, 1); | |
lcd.print(valor); | |
delay(5000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment