diff --git a/sketches/max_sketch/LDR_Test_1/LDR_Test_1.ino b/sketches/max_sketch/LDR_Test_1/LDR_Test_1.ino new file mode 100644 index 0000000..c5e956f --- /dev/null +++ b/sketches/max_sketch/LDR_Test_1/LDR_Test_1.ino @@ -0,0 +1,21 @@ +#define IN3 (A3) +int VAL3; +int MAP3; +int CONST; + +void setup() { +Serial.begin(9600); +} + +void loop() { +VAL3=analogRead(IN3); +Serial.print(VAL3); +MAP3 = map(VAL3, 70, 500, 10, 1200); +CONST = constrain(MAP3, 1, 1200); +tone(11, CONST); +Serial.print("\t"); +Serial.print(MAP3); +Serial.print("\t"); +Serial.println(CONST); +//delay(50); +}