Author: eur.van.andel
Date: Wed Nov 19 03:49:38 2008
New Revision: 571

Added:
    trunk/unvalidated/sample/by_device/16f877a/sample_co2_t6603.jal
       - copied, changed from r569,  
/trunk/unvalidated/sample/by_device/16f877a/read_co2_t6603.jal

Log:
buildbot had some remarks. renamed to sample as well


Copied: trunk/unvalidated/sample/by_device/16f877a/sample_co2_t6603.jal  
(from r569, /trunk/unvalidated/sample/by_device/16f877a/read_co2_t6603.jal)
==============================================================================
--- /trunk/unvalidated/sample/by_device/16f877a/read_co2_t6603.jal       
(original)
+++ trunk/unvalidated/sample/by_device/16f877a/sample_co2_t6603.jal     Wed Nov 
 
19 03:49:38 2008
@@ -10,7 +10,8 @@
  -- from the GE/Telaire CO2 sensor, using the serial_hardware, delay
  -- and t6603_co2 library. It uses a 4x16 LCD for user interaction.
  --
--- Note: the sensors sometimes gives a wrong value, this is just after it
+-- Note: the CO2 sensor needs some 20s to get heated after powerup. Just  
wait.
+-- The sensor sometimes gives a wrong value, this is just after it
  -- updates the internal value. This can be overcome by polling the status  
byte
  -- until it is non-zero, then waiting for a second before polling the ppm  
value.
  -- This is not done here.
@@ -34,16 +35,20 @@
  serial_hw_init()                              -- calculate baudrate, turn 
peripheral on


+const byte LCD_CHARS = 20
+const byte LCD_LINES = 4
+
  var  bit  LCD_RS        is pin_b5       -- LCD command/data select.
  var  bit  LCD_EN        is pin_b4       -- LCD data trigger
-var byte  lcd_data_port is portb_low    -- LCD data
+var byte  lcd_dataport is portb_low    -- LCD data
  portb_direction       = all_output    -- LCD data is portb_low
  include lcd_hd44780_4                 -- LCD library with 4 data lines
+
  include print                         -- nice formatted output

  delay_100ms(5)                                                -- to get the 
LCD up & running

-include t6603_co2
+include co2_t6603

  -- ---------------- VARIABLES ---------------------------

@@ -52,9 +57,9 @@
  -- --------------- START PROGRAM ---------------------------

  lcd_clearscreen()
-lcd_set_cursor(0,0)
+lcd_setcursor(0,0)
  const byte str1[] = "CO2 monitor"
-print_string(hd44780, str1)             -- output string to LCD
+print_string(lcd, str1)             -- output string to LCD
  delay_100ms(30)

  lcd_clearscreen()
@@ -62,7 +67,7 @@
  forever loop

        CO2 = get_co2_ppm()
-       lcd_set_cursor(0, 0)                                    -- row 1, 
position = 1
+       lcd_setcursor(0, 0)                                     -- row 1, 
position = 1
        print_word_dec(lcd, CO2)
        lcd="p" lcd="p" lcd="m" lcd =" " lcd =" " lcd =" "
                

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to