This shows you the differences between two versions of the page.
tutorials:cb1:customization:ds18b20_via_1-wire [2013/11/23 12:19] soloforce |
tutorials:cb1:customization:ds18b20_via_1-wire [2013/12/23 14:50] (current) |
||
---|---|---|---|
Line 46: | Line 46: | ||
===== Connection of DS18B20 ===== | ===== Connection of DS18B20 ===== | ||
- | DS18B20's connection is quite easy. Take the external power supply method for example, DS18B20's Vdd & Gnd pins will be connected to Cubieboard's Vcc(both 3.3v and 5.0v will be fine) & Gnd respectively, and the signal pin will be connected to the expansion pin defined in the script.fex, say, PB10(refer this:http://docs.cubieboard.org/products/a10_cubieboard/expansion_ports). And don's forget add a pull-up resistor between the signal pin and Vdd. | + | DS18B20's connection is quite easy. Take the external power supply method for example, DS18B20's Vdd & Gnd pins will be connected to Cubieboard's Vcc(both 3.3v and 5.0v will be fine) & Gnd respectively, and the signal pin will be connected to the expansion pin defined in the script.fex, say, PB10(refer this:http://docs.cubieboard.org/products/a10_cubieboard/expansion_ports). And don's forget add a pull-up 4.7KΩ resistor between the signal pin and Vdd. |
===== C Code ===== | ===== C Code ===== | ||
The following code fetch temperature data from a DS18B20 in every 5 seconds, together with current localtime, and display on a 8-digits 8-segments common anode LED-displayer. This code piece depends on Cubieboard GPIO Library, you can download it {{:tutorials:cb1:customization:cubieboard_gpio_lib.tar.gz|here}}. | The following code fetch temperature data from a DS18B20 in every 5 seconds, together with current localtime, and display on a 8-digits 8-segments common anode LED-displayer. This code piece depends on Cubieboard GPIO Library, you can download it {{:tutorials:cb1:customization:cubieboard_gpio_lib.tar.gz|here}}. | ||
Line 270: | Line 270: | ||
{{ :tutorials:cb1:customization:155732pzfqqzd4aqcmp7dq.jpg?500 |}} | {{ :tutorials:cb1:customization:155732pzfqqzd4aqcmp7dq.jpg?500 |}} | ||
<WRAP noprint> | <WRAP noprint> | ||
- | {{tag>Cubieboard Cubietruck}} | + | {{tag>Cubieboard Cubieboard2 DS18B20 OneWire}} |
</WRAP> | </WRAP> |