703
edits
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
== resistive Sensor == | |||
[[File:Resistive_Sensor_Steckplatine.png|thumb]] | |||
[[File:Potentiometer_A0_Serial_Steckplatine.png|thumb]] | |||
Recipe for resistive sensor: | |||
* Pick a resistive sensor | |||
* Measure its lowest and highest resistance using a multimeter. | |||
* Write the name of the sensor and the maximum and minimum resistance on the black board. | |||
* pick a resistor which has the same value as the sensor on its highest value | |||
* Use the below code and create the circuit for a resistive sensor | |||
* open the serial monitor and have a look at the values. | |||
* try larger and smaller resistors and see the difference. | |||
* use an other sensor (one that is already listed on the black board) | |||
Recipe for Potentiometer: | |||
* connect the Potentiometer as displayed on the right. | |||
* use the same program as before for the analog sensor | |||
* see what values you get - compare with values from the resistive sensor. | |||
<source lang="c"> | <source lang="c"> | ||
Line 17: | Line 35: | ||
} | } | ||
</source> | </source> | ||
<br clear="all"> | |||
== switch or Button == | |||
[[File:Button_1k_Pullup_Steckplatine.png]] | [[File:Button_1k_Pullup_Steckplatine.png|thumb]] | ||
<source lang="c"> | <source lang="c"> | ||
Line 43: | Line 62: | ||
} | } | ||
</source> | </source> | ||
<br clear="all"> |
edits