Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:examples:sensor:1-wire [2012/06/09 09:48] raivo.sellen: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  "onewire.h" and "onewire.c" to the program. Sensor-specific code is located in "ds18x20.h" and "ds18x20.c" files. Example code enabling to read the temperature with 1-wire protocol is shown below. It is important to include  "onewire.h" and "onewire.c" to the program. Sensor-specific code is located in "ds18x20.h" and "ds18x20.c" files.
  
-~~PB~~+<pagebreak>
  
 <code c> <code c>
Line 51: Line 51:
 #include "onewire.h" #include "onewire.h"
 #include "ds18x20.h" #include "ds18x20.h"
- 
 #include <homelab/module/lcd_gfx.h> #include <homelab/module/lcd_gfx.h>
 #include <homelab/delay.h> #include <homelab/delay.h>
Line 81: Line 80:
    
   // Multiplexer's pin configuration as a output and then switchover it     // Multiplexer's pin configuration as a output and then switchover it  
-  // 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);
   }   }
 } }
 </code> </code>
en/examples/sensor/1-wire.1339235296.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0