Created
April 1, 2019 05:32
-
-
Save teos0009/571d77e1bb4e3de6652d095d1cdb9c02 to your computer and use it in GitHub Desktop.
ArduinoLDR
This file contains 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
//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