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:thermistor [2015/11/13 09:43] heikopikneren:examples:sensor:thermistor [2020/07/20 09:00] (current) – external edit 127.0.0.1
Line 75: Line 75:
  // If the value in the table is the same or higher than measured   // If the value in the table is the same or higher than measured 
  // value, then the temperature is at least as high as the   // value, then the temperature is at least as high as the 
- // temperature corresponding to the element.+ // temperature corresponding to the element
  if (adc_value >= conversion_table[celsius]))  if (adc_value >= conversion_table[celsius]))
  {  {
  // Since the table begins with 0 but values of the elements   // Since the table begins with 0 but values of the elements 
- // from -20, the value must be shifted.+ // from -20, the value must be shifted
  return celsius + min_temp;  return celsius + min_temp;
  }  }
Line 94: Line 94:
  
 <code c> <code c>
-// Example program of the thermistor of Sensors module. +// Example program of the thermistor of Sensors module 
-// The temperature is displayed on the LCD.+// The temperature is displayed on the LCD
 #include <stdio.h> #include <stdio.h>
 #include <homelab/adc.h> #include <homelab/adc.h>
Line 139: Line 139:
  temperature = thermistor_calculate_celsius(value);  temperature = thermistor_calculate_celsius(value);
  
- // Converting the temperature in to text. + // Converting the temperature in to text 
- // To display the degree sign, the octal variable is 56.+ // To display the degree sign, the octal variable is 56
  sprintf(text, "%d\56C   ", temperature);  sprintf(text, "%d\56C   ", temperature);
  
- // Displaying the text in the beginning of the third row of the LCD.+ // Displaying the text in the beginning of the third row of the LCD
  lcd_gfx_goto_char_xy(5, 3);  lcd_gfx_goto_char_xy(5, 3);
  lcd_gfx_write_string(text);  lcd_gfx_write_string(text);
en/examples/sensor/thermistor.1447407784.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