25 Temmuz 2014 Cuma

Arduino 3 - Analog Giriş Okuma

https://gist.github.com/keanhm2/a30c4cd9698cd4720ac2

int analogDeger = 0;
int analogGiris = 0;
int gerilimDegeri = 0;

int pwmLED1 = 11;

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  analogDeger = analogRead(analogGiris);
  gerilimDegeri = (analogDeger / 1023.0)*5.0;
  Serial.print("Gerilim = " );
  Serial.print(gerilimDegeri);
  Serial.println("V");
  delay(2000);

  analogWrite(pwmLED1, analogDeger/4.0);
}








Hiç yorum yok:

Yorum Gönder