Changeset 5fb6ac6
- Timestamp:
- 02/16/2011 09:36:26 PM (14 years ago)
- Branches:
- master
- Children:
- 2c8a317
- Parents:
- 789d162
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
de.wigbels.avr/sketchbook/hothotheat/hothotheat.pde
r789d162 r5fb6ac6 35 35 int debounce = 0; 36 36 int slewRate = LOW; 37 int everySecond = false;37 int everySecond = 0; 38 38 39 39 unsigned long gasReeds = 0; … … 44 44 // Identify butterfly running program... 45 45 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 ); 52 47 53 48 TempSense.overSample = true; 54 55 49 pinMode( inputReed, INPUT ); 56 50 pinMode( outputLED, OUTPUT ); … … 58 52 digitalWrite( outputLED, HIGH ); 59 53 temp = TempSense.getTemp( CELSIUS ); 54 55 Serial.begin( 9600 ); 60 56 } 61 57 62 58 63 void secTick()59 void logOutput() 64 60 { 65 61 LCD.print( gasReeds ); … … 67 63 LCD.print( temp ); 68 64 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 ); 70 84 } 71 85 … … 106 120 digitalWrite( outputLED, HIGH ); 107 121 } 108 109 // Output of110 if ( everySecond==true ) {111 everySecond = false;112 113 // Temperature114 Serial.print( "1" );115 Serial.print( "\t" );116 Serial.println( temp );117 118 // Reed HIGH or Low119 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 Reeds128 Serial.print( "3" );129 Serial.print( "\t" );130 Serial.println( gasReeds );131 }132 122 133 delay(30); 123 if ( everySecond > 20 ) { 124 everySecond = 0; 125 logOutput(); 126 } else { 127 everySecond++; 128 } 129 130 delay( 30 ); 134 131 }
Note:
See TracChangeset
for help on using the changeset viewer.