Trombone Controller Sensors

I’m supposed to be writing Chapter 6 of Begin to Code Cloud. But I keep been drawn towards designs for a trombone based game controller. Because of this game. I’ve bought a copy and it is hilarious. But I want to play it with something approaching a real trombone. To do that I’ll need a sensor to read the position of the trombone slide. First instinct was to use an ultrasonic distance sensor, so I wired one up and dropped out a bit of code. That’s the device on the top. The problem with this is that as the distances being measured increase the whole thing slows down, what with the time taken for the ultrasonic pulse to go out and bounce back. So I’ve switched to using lasers. The device on the bottom uses a laser-based sensor (which I love) which works very quickly at any distance.

I’m using the sensors from Circuit Python at the moment. I’m going to have to decide whether or not it can go fast enough to get smooth readings. Early tests indicate that it might be OK but the distance readings are a bit noisy. But I think it should work. And now back to chapter 6….