optical end stop April 10, 2018 11:43AM |
Registered: 11 years ago Posts: 157 |
//int aPin = A0; int dPin = 11; int v = 0; void setup() { pinMode(dPin,INPUT); Serial.begin(9600); } void loop() { // v = analogRead(aPin); v = digitalRead(dPin); Serial.println(v); }digitalRead only returned 1 and analogRead returns an integer between 190 and 220 randomly regardless of whether the sensor was blocked or not.
Re: optical end stop April 11, 2018 09:15AM |
Admin Registered: 13 years ago Posts: 6,995 |
Re: optical end stop April 11, 2018 09:24AM |
Admin Registered: 13 years ago Posts: 6,995 |
Re: optical end stop April 11, 2018 07:53PM |
Registered: 11 years ago Posts: 157 |
Re: optical end stop April 11, 2018 11:17PM |
Admin Registered: 13 years ago Posts: 6,995 |
Re: optical end stop April 12, 2018 12:03PM |
Registered: 11 years ago Posts: 157 |
Quote
Dust
The tech is correct, the led should change state as well as the output voltage, you shouldn't even need a nano, just power and gnd and something to interrupt the light
Re: optical end stop April 13, 2018 06:30AM |
Admin Registered: 13 years ago Posts: 6,995 |
Re: optical end stop April 13, 2018 10:57AM |
Registered: 11 years ago Posts: 157 |