source: de.wigbels.ruby/hothotread/hothotpiper.rb @ 0955336

Last change on this file since 0955336 was 0955336, checked in by njw <njw@…>, 9 years ago

HotHotPiper? reeds gas usage

  • Property mode set to 100644
File size: 696 bytes
Line 
1#!/usr/bin/env ruby
2#
3# Author: Norbert Wigbels - foobla.wigbels.de/uber-foobla
4#
5# HotHotPiper continously reads the status of a
6# reed contact attached to the Raspberry Pi GPIO
7#
8# The reed measures gas usage.
9#
10# A magig URL is formed and called; the url
11# stores the sensor-data to wigbels.net
12#
13# todo: status-led
14#
15
16#------------------------------------------
17# Tainted mode 0-4
18$SAFE=0
19
20
21#------------------------------------------
22require 'net/http'
23require 'pi_piper'
24
25include PiPiper
26
27
28watch :pin => 4, :trigger => :falling do 
29  puts('added 100 liter of gas to sensor-database')
30  Net::HTTP.get(URI.parse('http://www.wigbels.net/cgi-bin/hhw.rb?sensorid=1&data=10'))
31end
32
33PiPiper.wait
Note: See TracBrowser for help on using the repository browser.