Author Topic: Robot  (Read 466 times)

aishen

  • Newbie
  • *
  • Posts: 30
    • View Profile
Robot
« on: 2016-December-14 01:15:04 am »
I baught an elegoo robot car and there is no much pain to use visualino.
But I did a temperatura LCD and I don't know how to enter the variable temp, any help ?
-----------------------------------------------
#include <Wire.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8,9, 10, 11, 12);
double Thermister(int RawADC)
{
  double Temp;
  Temp = log(((10240000/RawADC) - 10000));
  Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));
  Temp = Temp - 220.15; // Convertir Kelvin en Celcius

  return Temp;
}

void setup()
{
  //lcd.begin(16,2);
  //lcd.clear();

  Serial.begin(9600);
}

void loop()
{
  lcd.begin(16,2);
  Serial.println(int(Thermister(analogRead(0)))); // Afficher Fahrenheit

  lcd.print(int(Thermister(analogRead(0))));

  lcd.print(" degres ");

  delay(100);

  lcd.clear();
}