This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:examples:sensor:1-wire [2012/06/09 09:48] – raivo.sell | en:examples:sensor:1-wire [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 43: | Line 43: | ||
| Example code enabling to read the temperature with 1-wire protocol is shown below. It is important to include | Example code enabling to read the temperature with 1-wire protocol is shown below. It is important to include | ||
| - | ~~PB~~ | + | < |
| <code c> | <code c> | ||
| Line 51: | Line 51: | ||
| #include " | #include " | ||
| #include " | #include " | ||
| - | |||
| #include < | #include < | ||
| #include < | #include < | ||
| Line 81: | Line 80: | ||
| // Multiplexer' | // Multiplexer' | ||
| - | // to connect external sensor with the controller . | + | // to connect external sensor with the controller. |
| pin_setup_output(multiplexer_pin); | pin_setup_output(multiplexer_pin); | ||
| pin_set(multiplexer_pin); | pin_set(multiplexer_pin); | ||
| Line 140: | Line 139: | ||
| error++; | error++; | ||
| } | } | ||
| - | |||
| } | } | ||
| else | else | ||
| Line 159: | Line 157: | ||
| lcd_gfx_write_string(" | lcd_gfx_write_string(" | ||
| } | } | ||
| - | |||
| sw_delay_ms(500); | sw_delay_ms(500); | ||
| } | } | ||
| } | } | ||
| </ | </ | ||