This shows you the differences between two versions of the page.
iotcluj:labs:05 [2016/07/13 11:44] ioana_maria.culic [The Code] |
iotcluj:labs:05 [2016/07/13 12:33] (current) ioana_maria.culic [Exercises] |
||
---|---|---|---|
Line 64: | Line 64: | ||
<note>When you configure the Arduino port set the it to **global**</note> | <note>When you configure the Arduino port set the it to **global**</note> | ||
+ | {{ :iotcluj:labs:arduino-global.png?400 |}} | ||
Further on, you need to specify which pin you want to read from. In this case, the pin is 0 and is an analog pin. Afterwards, you will use a **range** node in order to map the read values to values that should light up the LED. For this, you need to adapt the system to your environment. Depending on the regular amount of light, usually you will read a value of around 400. So in this case, the range scales values going from 400 to 1024 to 0 to 255. However, if the regular value is different, you will need to scale a different range. | Further on, you need to specify which pin you want to read from. In this case, the pin is 0 and is an analog pin. Afterwards, you will use a **range** node in order to map the read values to values that should light up the LED. For this, you need to adapt the system to your environment. Depending on the regular amount of light, usually you will read a value of around 400. So in this case, the range scales values going from 400 to 1024 to 0 to 255. However, if the regular value is different, you will need to scale a different range. | ||
Line 78: | Line 78: | ||
===== Exercises===== | ===== Exercises===== | ||
- | - Connect a rotary angle and send the read values to the dashboard. | + | - Connect a potentiometer and send the read values to the dashboard. |
- Display the values coming from the light sensor in the dashboard using the **gauge** graph. | - Display the values coming from the light sensor in the dashboard using the **gauge** graph. | ||
- Connect all the sensors in the kit to the Arduino and display the values you read in the dashboard. **Note:** Do not connect the Hall sensor, which works in a different way. | - Connect all the sensors in the kit to the Arduino and display the values you read in the dashboard. **Note:** Do not connect the Hall sensor, which works in a different way. |