class RPiPhotocell
To use this gem you will need the following:
-
a Raspberry Pi
-
an MCP3008 10-bit Analog-to-Digital Converter (ADC)
-
a Photoresistor en.wikipedia.org/wiki/Photoresistor
Public Class Methods
new(pin: 0, clock: 18, dout: 23, din: 24, cs: 25)
click to toggle source
Calls superclass method
# File lib/rpi_photocell.rb, line 16 def initialize(pin: 0, clock: 18, dout: 23, din: 24, cs: 25) super pin, clock, dout, din, cs end
Public Instance Methods
read()
click to toggle source
reads the analog value
Calls superclass method
# File lib/rpi_photocell.rb, line 24 def read() super() end