Skip to content

Instantly share code, notes, and snippets.

@teos0009
Created April 1, 2019 05:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teos0009/571d77e1bb4e3de6652d095d1cdb9c02 to your computer and use it in GitHub Desktop.
Save teos0009/571d77e1bb4e3de6652d095d1cdb9c02 to your computer and use it in GitHub Desktop.
ArduinoLDR
//basic code to read value from A0 display to serial monitor
#include <SoftwareSerial.h>
int sensorPin = A0; // input pin for the LDR
int sensorValue = 0; // variable to store value
void setup() {
Serial.begin(9600);
}
void loop()
{
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment