config stuff
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#define LEDPIN 8
|
||||
|
||||
String incomingString;
|
||||
|
||||
void setup() {
|
||||
pinMode(LEDPIN, OUTPUT);
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (Serial.available() > 0) {
|
||||
char cmd = Serial.read();
|
||||
if (cmd == 'O') {
|
||||
digitalWrite(LEDPIN, HIGH); // Open
|
||||
} else if (cmd == 'C') {
|
||||
digitalWrite(LEDPIN, LOW); // Close
|
||||
} else if (cmd == 'R') {
|
||||
int ldrValue = analogRead(A0);
|
||||
Serial.println(ldrValue);
|
||||
}
|
||||
}
|
||||
delay(50);
|
||||
}
|
||||
Reference in New Issue
Block a user