Changeset 5fb6ac6


Ignore:
Timestamp:
02/16/2011 09:36:26 PM (14 years ago)
Author:
njw <njw@…>
Branches:
master
Children:
2c8a317
Parents:
789d162
Message:

new putzaleit dir

File:
1 edited

Legend:

Unmodified
Added
Removed
  • de.wigbels.avr/sketchbook/hothotheat/hothotheat.pde

    r789d162 r5fb6ac6  
    3535int debounce = 0;
    3636int slewRate = LOW;
    37 int everySecond = false;
     37int everySecond = 0;
    3838
    3939unsigned long gasReeds = 0;
     
    4444  // Identify butterfly running program...
    4545  LCD.prints_f( PSTR( "HOTHOTHEAT" ) );
    46   delay( 2500 );
    47  
    48   // Set up the RTC timer to call the secTick() function every second.
    49   RTCTimer.init( secTick );
    50  
    51   Serial.begin( 9600 );
     46  delay( 1400 );
    5247
    5348  TempSense.overSample = true;
    54 
    5549  pinMode( inputReed, INPUT );
    5650  pinMode( outputLED, OUTPUT );
     
    5852  digitalWrite( outputLED, HIGH );
    5953  temp = TempSense.getTemp( CELSIUS );
     54 
     55  Serial.begin( 9600 );
    6056}
    6157
    6258
    63 void secTick()
     59void logOutput()
    6460{
    6561  LCD.print( gasReeds );
     
    6763  LCD.print( temp );
    6864  LCD.println( " C" );
    69   everySecond=true;
     65
     66  // Temperature
     67  Serial.print( "1" );
     68  Serial.print( "\t" );
     69  Serial.println( temp );
     70
     71  // Reed HIGH or Low 
     72  Serial.print( "2" );
     73  Serial.print( "\t" );
     74  if( slewRate==1 ) {
     75      Serial.println( "HIGH" );
     76  } else {
     77      Serial.println( "LOW" );
     78  }
     79 
     80  // Total of Gas Reeds
     81  Serial.print( "3" );
     82  Serial.print( "\t" );
     83  Serial.println( gasReeds );
    7084}
    7185
     
    106120    digitalWrite( outputLED, HIGH );
    107121  }
    108 
    109   // Output of
    110   if ( everySecond==true ) {
    111     everySecond = false;
    112 
    113     // Temperature
    114     Serial.print( "1" );
    115     Serial.print( "\t" );
    116     Serial.println( temp );
    117 
    118     // Reed HIGH or Low 
    119     Serial.print( "2" );
    120     Serial.print( "\t" );
    121     if( slewRate==1 ) {
    122         Serial.println( "HIGH" );
    123     } else {
    124         Serial.println( "LOW" );
    125     }
    126  
    127     // Total of Gas Reeds
    128     Serial.print( "3" );
    129     Serial.print( "\t" );
    130     Serial.println( gasReeds );
    131   }
    132122   
    133   delay(30);
     123  if ( everySecond > 20 ) {
     124    everySecond = 0;
     125    logOutput();
     126  } else {
     127    everySecond++;
     128  }
     129   
     130  delay( 30 );
    134131}
Note: See TracChangeset for help on using the changeset viewer.