CNY70

 0,79 Incl, BTW

94 in stock

SKU: 060420231005 Categories: ,

Description

CNY70 Reflective Optical Sensor with Transistor Output – often used for line follower robots to detect a surface or a black line.

CNY70 Arduino
CNY70 Arduino

SOURCECODE

// ————————————————————————-
// CNY70ReadSerial
// Reads an analog input on pin 0, prints the result to the Serial Monitor.
// ————————————————————————-

// the setup routine runs once when you press reset:
void setup()
{
Serial.begin(9600);
}

void loop()
{
int sensorValue = analogRead(A0);
Serial.println(sensorValue);
delay(100); // delay in between reads for stability
}

Determine the minimum and maximum treshold values and use these in the code to determine if f.i. a black line is stil under the sensor.

Additional information

Weight 0,004 kg