# Playing videos alternately

**URL:** <https://discourse.processing.org/t/playing-videos-alternately/25432>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [November 15, 2020, 1:42am UTC](https://discourse.processing.org/t/playing-videos-alternately/25432 "2020-11-15T01:42:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johnny](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Johnny](https://discourse.processing.org/u/Johnny)\
**Post date:** [November 15, 2020, 1:42am UTC](https://discourse.processing.org/t/playing-videos-alternately/25432/1 "2020-11-15T01:42:18Z")

</div>

Hello! I am trying to play two videos alternately depending on the distance measurement of the ultrasonic sensor. This is my first time using both Arduino and processing, and I’m lost in setting values properly. I don’t know why processing is getting the wrong measurement from the serial list. It shows random numbers that don’t match the ones from Arduino’s serial monitor.

---

<div class="post-metadata">

**Author:** ![tony](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tony/32/949_2.png) [@tony](https://discourse.processing.org/u/tony)\
**Post date:** [November 15, 2020, 4:00am UTC](https://discourse.processing.org/t/playing-videos-alternately/25432/2 "2020-11-15T04:00:38Z")

</div>

Random numbers from the port probably means you’re not getting actual sensor data, just noise.

I’d suggest testing step by step. First debug the sensor and make sure you’re getting a consistent signal.

One piece at a time!
