Skip to content

Instantly share code, notes, and snippets.

@tom-a
Last active March 13, 2019 19:11
Show Gist options
  • Save tom-a/5c7e5fa1b175a037354cf566459840c8 to your computer and use it in GitHub Desktop.
Save tom-a/5c7e5fa1b175a037354cf566459840c8 to your computer and use it in GitHub Desktop.
/*
気温測定
LM35Zをアナログポートにつないで測定
ARDUINO UNO用
*/
void setup() {
Serial.begin(9600);
analogReference(INTERNAL);
}
void loop() {
int sensorValue = analogRead(A0);
float temperature = sensorValue * 110.0 / 1023.0;
Serial.println(temperature);
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment