Ignore:
Timestamp:
Mar 12, 2019, 2:56:41 PM (5 years ago)
Author:
Norbert Wigbels <frickel@…>
Branches:
master
Children:
7c920d4
Parents:
b86cdd7
Message:

Wasser, finally

File:
1 edited

Legend:

Unmodified
Added
Removed
  • de.wigbels.ruby/hothotread/hothotpiper_water.rb

    rb86cdd7 raa10f5c  
    77
    88mypath = File.expand_path(File.dirname(__FILE__))
    9 trigger_step = 0.001
     9trigger_step = 1
    1010trigger_watch = 0
    1111counter = 0.0
     
    2626end
    2727
    28 watch :pin => 9, :trigger => :rising do
     28watch :pin => 18, :trigger => :falling do
    2929  puts('triggered watch to 1')
    3030  trigger_watch = 1
     
    4040    if trigger_watch == 1 then
    4141      counter = counter + trigger_step
    42 #system("rrdtool update #{rrdpath} N:#{counter}:#{trigger_step}")
     42      system("rrdtool update #{rrdpath} N:#{counter}:#{trigger_step}")
    4343      puts('Counter updated to: ' + counter.to_s)
    4444      timestamp =  Time.now.to_i
    4545      trigger_watch = 0
    4646    elsif Time.now.to_i - timestamp > 3600
    47 #     system("rrdtool update #{rrdpath} N:#{counter}:0")
     47      system("rrdtool update #{rrdpath} N:#{counter}:0")
    4848      timestamp = Time.now.to_i
    4949    end
Note: See TracChangeset for help on using the changeset viewer.