How do you select between two signals?

I have a temperature sensor, a button, and a number.

I want the number to normally show the temperature, but when the button is pressed down, I want it to show 99.

I can figure out how to make the button make it show 0 (power-button-invertor-temp-number). I can figure out how to make the button show a number over 50 when it’s pressed and have the temperature divided by two when it’s not (using a mix). I can’t figure out how to leave the temperature signal intact except when the button is pressed and when it’s pressed to force the signal to 99.

Hi !
Im afraid you’ll have to use the arduino bit to accomplish that. You should use the analog input to measure the temperature sensor and a digital input to read the button state. A simple program will output one of these two signals to your number bit.
If you have the perf bit or protobit, I can come up with a small circuit that can just do the same.
I will have a look at it in the weekend.

Thanks. Yeah, I figured the codebit could do this too. I was hoping to do it with just regular bits. Oh well.

A bit that can do this kind of thing would be a great new addition to the bit library.

1 Like

Hi Ian @Hixie,

I found a solution for your temperature sensor reading with the button showing 99…

It can be done when you have one protobit, three little wires and you like soldering to make your own relay bit, as I did a while ago, see this project with a detailed description:

This relay bit can be connected to the temperature sensor and to the internal VCC (5 Volt) of the system and it selects between these two by activating the button. see this basic diagram:

Here you can see the reading in action: