Using a photo interrupt sensor and an encoder motor

Hello,

I was wondering if anyone could help us. We are trying to combine a ky-010 photo interrupt sensor module and an encoder motor but we have a serial clash.

We are trying to get the photo interrupt to print to one serial the 9600 baud and the encoder to print to the other.

we are trying to make a smoke sensor that detects smoke when the smoke comes between the emitter and the receiver nodes of the photo interrupter and print a value to the serial monitor

alongside this we are trying to get the encoder motor to read from its own separate data to set its rpm.

The encoder is attached to a fan which will turn on when there is too much smoke in the air.

smoke_motor.ino (3.96 KB)

Sounds like an interesting project. How's the progress?

slow

having trouble getting the encoder and the photo interrupt working. We need them to have two different places for them to read and write to. we have the two separate pieces of code working but having trouble integrating them