pi_sensor 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ .rvmrc
1
2
  *.gem
2
3
  *.rbc
3
4
  .bundle
data/README.md CHANGED
@@ -16,9 +16,24 @@ Or install it yourself as:
16
16
 
17
17
  $ gem install pi_sensor
18
18
 
19
+ ## A note about pin numbering
20
+
21
+ Raspberry Pi pin numbering can be confusing. The pin numbers used in this
22
+ library are the wiringPi pin numbers: https://projects.drogon.net/raspberry-pi/wiringpi/pins
23
+
19
24
  ## Usage
20
25
 
21
- TODO: Write usage instructions here
26
+ Here's an example using the [SHT15](https://www.sparkfun.com/products/8257) temperture/humidty sensor.
27
+ Note that you need to run this code as root or with `sudo`:
28
+
29
+ require 'wiringpi'
30
+
31
+ # Connects Pi physical pin 11 to SCK and Pi physical pin 12 to DATA
32
+ sensor = PiSensor::SHT15.new :clock => 0, :data => 1
33
+
34
+ # And then simply query for the temperature and humidity
35
+ puts " Temperature: #{sensor.temperature}°C"
36
+ puts " Humidity: #{sensor.humidity}%"
22
37
 
23
38
  ## Contributing
24
39
 
@@ -1,3 +1,3 @@
1
1
  module PiSensor
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
data/pi_sensor.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.email = ["cannikinn@gmail.com"]
11
11
  gem.description = %q{Use Ruby to talk to a bunch of sensors with your Raspberry Pi.}
12
12
  gem.summary = %q{Use Ruby to talk to a bunch of sensors with your Raspberry Pi.}
13
- gem.homepage = ""
13
+ gem.homepage = "https://github.com/cannikin/pi_sensor"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pi_sensor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -43,7 +43,7 @@ files:
43
43
  - lib/pi_sensor/sht15.rb
44
44
  - lib/pi_sensor/version.rb
45
45
  - pi_sensor.gemspec
46
- homepage: ''
46
+ homepage: https://github.com/cannikin/pi_sensor
47
47
  licenses: []
48
48
  post_install_message:
49
49
  rdoc_options: []