Next: Arduino I/O package, Previous: Arduino Addons, Up: Function Reference [Contents][Index]
DS1307 realtime clock sensor
Constructor to create DS1307 sensor
arObj - the arduino parent object
propertyname, propertyvalue - optional property name, value pairs. Current known properties are: Current properties are:
I2C address of the DS1307 (default 0x68)
obj - created DS1307 object
a = arduino()
rtc = arduinosensor.DS1307(a)
Get/set the DS1307 clock
dsObj - the ds1307 object
date - a date vector in same format as datevec and clock
date - a date vector in same format as datevec and clock
a = arduino()
rtc = arduinosensor.DS1307(a)
# get and display rtc time as a date string
datestr(rtc.clock)
See also: datevec.
Get/set the DS1307 clock
dsObj - the ds1307 object
ctrl - a structure containing the control bit fields.
ctrl - a structure containing the control bit fields.
Control structure fields are: Current properties are:
Out bit in the control register
Square wave enable bit in control register
The combined RS0, RS1 value
Get whether the RTC clock is currently counting time
dsObj - the ds1307 object
YN - returns true if the RTC is counting
See also: start, stop.
Start the RTC counting
dsObj - the ds1307 object
None
See also: datevec.
Stop the RTC counting
dsObj - the ds1307 object
None
See also: datevec.
A thin wrapper for the GUVAS12SD analog UV-B sensor
Constructor to create GUVAS12SD sensor
arObj - the arduino parent object
pin - the analog pin that the sensor is connected to
obj - created GUVAS12SD object
a = arduino()
# create sensor attached to pin a0.
sensor = arduinosensor.GUVAS12SD(a, "a0")
Read the voltage of the sensor
dsObj - the GUVAS12SD object
V - read voltage - effectively equivalent to readAnalogPin(arObj, pin).
a = arduino()
s = arduinosensor.GUVAS12SD(a)
# voltage
volts = s.read
See also: arduinosensor.GUVAS12SD.
Read the UV index
dsObj - the GUVAS12SD object
Idx - the sensor reading as a UV index reading
Read the uA of the sensor
dsObj - the GUVAS12SD object
uA - the sensor reading as a uAmp value
MCP3002 ADC sensor
Constructor to create MPC3002 sensor
arObj - the arduino parent object
selectPin - the SPI cs select pin
propertyname, propertyvalue - optional property name, value pairs.
Current properties are:
Reference voltage for scaling the ADC inputs (default 5.0)
obj - created MCP3002 object
a = arduino()
sensor = arduinosensor.MPC3002(a, "d10")
Read the voltage from a channel
dsObj - the MPC3002 object
chan - the channel to read (0 or 1)
voltage - read voltage.
a = arduino()
s = arduinosensor.MPC3002(a, "d10")
volts = readVoltage(s, 0)
See also: arduinosensor.MPC3002.
SI7021 temperature and humidity sensor
Constructor to create SI7021 sensor
arObj - the arduino parent object
propertyname, propertyvalue - optional property name, value pairs. Current known properties are: Current properties are:
I2C address of the SI7021 (default 0x40)
obj - created SI7020 object
a = arduino()
sensor = arduinosensor.SI7021(a)
Read the temperature
dsObj - the si7021 object
C - read temperature in deg C.
a = arduino()
s = arduinosensor.SI7021(a)
# get temp
temp = s.temperature
See also: arduinosensor.SI7021.
Read the relative humidity
dsObj - the si7021 object
relH - relative humidity as a percentage (0 - 100.0)
Read the sensor info
dsObj - the si7021 object
inf - structure containing the sensor information.
Structure fields are:
Chip firmware version
sensor id1,id2 value
String for detected chip type
Next: Arduino I/O package, Previous: Arduino Addons, Up: Function Reference [Contents][Index]