|
|
Line 29: |
Line 29: |
|
| |
|
|
| |
|
| Arduino light sensor | | Arduino light sensor + LED pin |
|
| |
|
| [[File:20210505_105113.jpg|400px]]
| |
| [[File:20210505_105123.jpg|400px]]
| |
|
| |
|
| the code i used:
| | <gallery> |
| | File:20210505_131826.jpg |
| | File:lightsensor.jpg |
| | </gallery> |
|
| |
|
| // global variables
| |
|
| |
|
| int sensor = A1;
| | Problems / Questions: |
| | - when i try to connect the scale to the slider the led pin and the built in led starts blinking fast and i can't control the led pin with the light sensor |
|
| |
|
| | | - what is the meaning of the select numbers "13, 10, 50, 51"? |
| void setup() {
| |
| | |
| // put your setup code here, to run once:
| |
| Serial.begin (9600); // start serial
| |
| }
| |
| | |
| void loop() {
| |
| | |
| // put your main code here, to run repeatedly:
| |
| | |
| | |
| int sensorValue = analogRead (sensor);
| |
| | |
| | |
| Serial.println (sensorValue);
| |
| }
| |
| | |
| | |
| Problems i encountered while trying to connect max msp and the arduino:
| |
| | |
| - when i try to run the patch from the first tutorial the numbers don't show on the console / print isnt working | |
| - led does not light up while running the code
| |