Robojoy challenge class

3-6 NXT intelligent block

Mechanism of NXT button 3

To improve the circuit, I tried to increase to two switches.
However, there's a problem with this, it becomes the same voltage press which of the two switches.

Therefore, we have given them in a separate voltage switches 1 and 2. If you read the difference in voltage, you will know which switch was pressed. In order to drop the voltage, you can use a resistor connected in series is called the "partial pressure"(You will learn in high school).

I tried to reproduce in this circuit on the breadboard. Switch 1 is Green, switch 2 is red. When you press the switch, electricity is transmitted to the ammeter.

I tried to press a switch 1. Voltmeter showed 1.75V.

I tried to press the switch 2. Voltmeter showed 5.31V.

Let's think about why it became so.
First, when the experiment was started, the voltage of the battery was 5.31V. Depends on the remaining amount of this battery, it will be changed. If you press a switch, voltmeter transmitted to become 1/3 of the battery voltage.
Since the battery is 5.31V, and to calculate,,, 5.31 รท 3 = 1.77 ,,, 1.77V. 1.75V is almost the same as the measurement results, will be named as the calculation. On the other hand, if you press the switch 2, it could lead to the battery voltmeter directly without passing through the resistor will be 5.31V.

Let's look at the circuit actually used in the NXT. Resistance that is for "R1" "R2" "R3" in the figure divide the circuit you can see. Part is the line that says for "BUTT_ADC" conveys the state of the switch. They seem to be interrupted in the middle; you are actually connected to the sub-processor. When a state of "BUTT_ADC" is not pressed, is a 0V voltage in, it will be all four kinds. In addition, the resistance of the "R4" is the pull-down resistor.