Changeset aa10f5c for de.wigbels.ruby/hothotread/hothotpiper_water.rb
- Timestamp:
- Mar 12, 2019, 2:56:41 PM (5 years ago)
- Branches:
- master
- Children:
- 7c920d4
- Parents:
- b86cdd7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
de.wigbels.ruby/hothotread/hothotpiper_water.rb
rb86cdd7 raa10f5c 7 7 8 8 mypath = File.expand_path(File.dirname(__FILE__)) 9 trigger_step = 0.0019 trigger_step = 1 10 10 trigger_watch = 0 11 11 counter = 0.0 … … 26 26 end 27 27 28 watch :pin => 9, :trigger => :rising do28 watch :pin => 18, :trigger => :falling do 29 29 puts('triggered watch to 1') 30 30 trigger_watch = 1 … … 40 40 if trigger_watch == 1 then 41 41 counter = counter + trigger_step 42 #system("rrdtool update #{rrdpath} N:#{counter}:#{trigger_step}")42 system("rrdtool update #{rrdpath} N:#{counter}:#{trigger_step}") 43 43 puts('Counter updated to: ' + counter.to_s) 44 44 timestamp = Time.now.to_i 45 45 trigger_watch = 0 46 46 elsif Time.now.to_i - timestamp > 3600 47 #system("rrdtool update #{rrdpath} N:#{counter}:0")47 system("rrdtool update #{rrdpath} N:#{counter}:0") 48 48 timestamp = Time.now.to_i 49 49 end
Note: See TracChangeset
for help on using the changeset viewer.