Compare commits

..

509 Commits

Author SHA1 Message Date
78182278cc upm: update to version 0.2.0
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-22 12:54:32 -07:00
3998cdfb1e docs: updated gsk sensors and @kit tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 15:43:24 -07:00
969a25cf0d adafruitss: updated sensor category to avoid name clash
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 15:32:20 -07:00
a2864d3559 ta12200: python example and JS modification for ta12200 electricity sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:49:40 -07:00
4ab6873a42 adc121c021: python example and JS modification for adc121c021 analog/digital converter
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:49:02 -07:00
7b0dce0992 hmtrp: python example for hmtrp Serial RF radio
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:48:30 -07:00
57bab4f9df l298: python examples for l298 dual-H bridge DC motor and stepper motor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:47:56 -07:00
4f4bd2937a ina132: python example for ina132 differential amplifier
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:47:24 -07:00
8c55b54969 groveehr: python example and js modification for groveehr heart-rate sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:46:50 -07:00
4f53c9c43a adafruitms1438: python examples for adafruitms1438 motor shield
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:46:17 -07:00
94fe1174c6 lsm303: python example and js modification for lsm303 accelerometer/compass
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:45:46 -07:00
f9d0e4621b groveloudness: python example for grove loudness sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:45:13 -07:00
3d535b5dec groveemg: python example for grove emg muscle signal reader
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:44:41 -07:00
97204cfc31 grovegsr: python example for grove gsr skin response sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:44:05 -07:00
d8dc267fef mma7660: python example for mma7660 accelerometer
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:43:29 -07:00
13704fffe0 gas: python examples for mq2, mq3, mq5, and mq9 gas sensors
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:42:55 -07:00
2ceee8bf26 grovevdiv: python example and js modification for grovevdiv voltage divider
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:42:21 -07:00
6c93816a77 cjq4435: python example and js modification for cjq4435 MOSFET sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:41:44 -07:00
20890aa2fb grovemd: python example for grovemd I2C motor driver
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:41:11 -07:00
c95af93490 adxl335: python example (and JS example modification) for adxl335 analog accelerometer
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:40:38 -07:00
60815f034d my9221: python example for my9221 LED bar
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:40:05 -07:00
357018109f tcs3414cs: python example for tcs3414cs I2C color sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:39:34 -07:00
de96a3d327 ds1307: python example for ds1307 RTC clock
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:39:02 -07:00
78482791c1 grovecollision: python example and updated JS example for grove collision sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:38:25 -07:00
2168b404bd groveo2: python example for grove O2 gas sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:37:44 -07:00
ff897e84eb wt5001: new python example and update to JS example for wt5001 mp3 player
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:37:07 -07:00
f0cd7843c7 groveelectromagnet: python example for grove electromagnet
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:36:30 -07:00
aedd3fa4e3 mpr121: python example for mpr121 touch sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:35:49 -07:00
e4ac7c4a13 otp538u: python example for otp538u Grove Infrared Temperature Sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:35:13 -07:00
aba51d10c7 rpr220: python example for rpr220 Infrared Reflective Sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:34:39 -07:00
999eca4598 enc03r: python example for enc03r analog gyro
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:34:04 -07:00
44d31a3dfd tsl2561: python example for tsl2561 digital light sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:33:31 -07:00
66913cdb20 a110x: python example for a110x hall effect (magnet) sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:32:58 -07:00
424ff42b29 grovelinefinder: python example for grove line finder sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:32:24 -07:00
afc4e508d5 grovespeaker: python example for grove speaker
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:31:48 -07:00
f5cd50f7ba rfr359f: python example for rfr359f IR Distance Interrupter
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:31:06 -07:00
018b731fab grovewater: python example for grove water sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:30:29 -07:00
6592cf58d3 guvas12d: python example for guvas12d UV sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:29:52 -07:00
28aacaade6 Jhd1313m1: extending python example for RGB display to match js/c++ examples
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:29:13 -07:00
fffcc2970e nunchuck: python example for nunchuck driver
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:28:36 -07:00
b5d3ab895b ssd1327: python example for ssd1327 OLED Display 0.96"
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:27:59 -07:00
950f4bf4ad mq303a: python example for mq303a alcohol sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:27:18 -07:00
544d76e6ff groveeldriver: python example for grove el driver
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:26:38 -07:00
99c59361a7 ssd1308: JavaScript, python examples for ssd1308 OLED Display 1.12"
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:26:00 -07:00
92039921b1 yg1006: python example for yg1006 flame sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:25:21 -07:00
bbd8483b65 bmpx8x: python example for BMP x8x family of barometers
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:24:43 -07:00
5ed438bc6b grovemoisture: python example for grove moisture sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:24:07 -07:00
2daed538b4 rotaryencoder: python example for rotary encoder
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:23:32 -07:00
14d45b89af at42qt1070: python example for at42qt1070 Q-touch sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:22:58 -07:00
08c116947a joystick12: python example for joystick12 sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:22:22 -07:00
2854302757 biss0001: python example for biss0001 motion sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:21:44 -07:00
51830a0953 ublox6: python example for ublox6 GPS sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:21:08 -07:00
22779337c8 ppd42ns: python example for ppd42ns dust sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-17 11:20:29 -07:00
8d40ca6f10 ldt0028: updated type after rename
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-16 17:14:54 -07:00
a2e80fcc29 flex: changed type name to avoid name clash
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-16 17:14:40 -07:00
7d1976e819 upm.h: removed unused vendors and added kits
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-16 17:14:25 -07:00
c6e87d8c16 adafruitss: placed under servo category
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-16 17:14:11 -07:00
d3471816ba zfm20: fixed doxygen tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-16 17:13:32 -07:00
65fd9804ea htu21d: fixed typo and removed bad altname
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-16 10:47:58 -07:00
8c7065ed09 adafruitms1438: updated header with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-16 10:46:11 -07:00
9a024f1aa1 lpd8806: patching up doxygen comments and removing image 2015-04-15 10:07:52 -07:00
475a4aa48a max5487: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 18:06:53 -07:00
666d7c8459 max31723: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 18:05:22 -07:00
d1258797b0 max31855: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 18:04:21 -07:00
3f09b4ee0c max44000: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 18:02:48 -07:00
72eebf5b6d maxds3231m: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 18:01:25 -07:00
aa94a8bd06 mhz16: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:59:59 -07:00
a48bd35893 mic: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:58:58 -07:00
b9090753db mlx90614: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:57:58 -07:00
76867d8db3 mma7455: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:56:57 -07:00
343bfa2148 mma7660: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:55:54 -07:00
999702e6be mpl3115a2: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:54:46 -07:00
045782b202 mpr121: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:53:45 -07:00
90feee05aa mpu9150: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:52:44 -07:00
9c164b8b9e mq303a: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:51:30 -07:00
ecba83edc5 my9221: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:50:30 -07:00
5dcdc2f9cc nrf24l01: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:49:14 -07:00
c3fbdb9e33 nrf8001: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:48:11 -07:00
55bf019411 nunchuck: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:47:08 -07:00
2ace28a75f otp538u: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:46:05 -07:00
d26b9a03d6 pca9685: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:44:55 -07:00
b3eb36ee47 ppd42ns: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:43:57 -07:00
4cc8adbec5 pulsensor: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:42:49 -07:00
bba42e748c rfr359f: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:37:50 -07:00
fa77863b13 rotaryencoder: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:36:50 -07:00
f0d9ac8fd6 rpr220: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:35:47 -07:00
f9dc9cc4e8 es08a: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:34:47 -07:00
ab5fc3f203 sm130: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:33:44 -07:00
6c45773b36 uln200xa: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:31:49 -07:00
be1c21c3f0 waterlevel: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:31:25 -07:00
04b9e19eeb zfm20: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:29:57 -07:00
b937f1ae3e isd1820: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:09:34 -07:00
ca29e0a307 grovewfs: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:08:08 -07:00
30c8efa3b6 uln200xa: Patching up doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:05:51 -07:00
b1421659c5 sm130: Adding doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:03:07 -07:00
2a7e9d9cb9 zfm20: patching doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 17:02:36 -07:00
47eaf93e4d isd1820: Initial implementation
This driver implements support for the Grove Recorder.  It records up
to about 10 seconds of audio, and can play it back on command.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 16:36:18 -07:00
ce1e2fd606 grovewfs: Initial implementation
This driver implements support for the Grove Water Flow sensor.  It
uses an integrated hall effect sensor, connected to a GPIO configured
as an interrupt, to compute water flow in LPM (Liters Per Minute).

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 16:36:10 -07:00
2a3485cf98 uln200xa: Initial implementation
This driver was tested on a Grove Geared Stepper with Driver, the
uln2003a paired with a 28BYJ-48 unipolar stepper motor.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 16:35:56 -07:00
8bf92be1ab zfm20: Initial implementation
This driver implements support for the ZFM20 fingerprint module.  It
was tested on a Grove Fingerprint Sensor.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 16:35:38 -07:00
bdaf952e91 grovergblcd: changed file name extension to match file
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 16:06:27 -07:00
1d2b85418e docs: adding grovergblcd image from seeed wiki
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 16:01:24 -07:00
cbd9dd7a2c docs: cleanup file permissions on images
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 16:00:25 -07:00
c7aec0b291 docs: removing image
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 15:45:23 -07:00
2ac8f8f6ef max5847: Adding doxygen comments and removing image
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 15:44:30 -07:00
897b0a48c6 max31723: Adding doxygen comments and removing image
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 15:41:31 -07:00
6da2d5047d max31855: Adding doxygen comments and removing image
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 15:36:11 -07:00
3567e079f9 maxds3231m: Adding doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 15:30:14 -07:00
a3354dca0d max44000: Adding doxygen comments removing image
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 15:29:10 -07:00
a327872241 maxds3231m: adding doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 15:23:24 -07:00
68fcd45873 mhz16: Adding doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 15:17:57 -07:00
2555aec888 mic: Adding doxygen comments and image from seeed wiki
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 15:13:17 -07:00
e9192d14c2 mma7455: Correcting doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 15:08:28 -07:00
08a81356da mlx90614: Adding doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 15:07:57 -07:00
234d166c84 mma7455: Adding doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 15:04:51 -07:00
5e6fdb5c30 mma7660: Adding doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 15:01:17 -07:00
a6a405be31 mpl3115a2: Adding doxygen comments and a manufacturer to upm.h
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 14:54:56 -07:00
0866fb880a nrf8001: Corrected connction type tag
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 14:29:11 -07:00
2376d853e7 mpr121: Adding doxygen comments and image from seeed wiki
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 14:28:25 -07:00
bc65345cf3 mpu9150: Adding doxygen comments and image from Seeed wiki
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 14:24:03 -07:00
f071ebe0ca mq303a: Adding doxygen comments and image from seeed wiki
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 14:16:12 -07:00
78f25b0157 my9221: Adding doxygen comments and image from Seeed wiki
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 14:09:03 -07:00
dfac49ede0 nrf24l01: Adding doxygen comments and image from seeed website
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 14:03:26 -07:00
6abf66ddbc nrf8001: Adding doxygen comments and image from Adafruit website
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 13:56:54 -07:00
1ffbcd59ad nunchuck: Adding doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 13:46:23 -07:00
c2b42842e4 otp538u: Adding doxygen comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 13:31:22 -07:00
7be414fa5b pca9685: Adding doxygen comments and image from adafruit site
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 13:14:34 -07:00
b10e108977 ppd42ns: Adding doxygen comments and image from seeed wiki
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 13:04:43 -07:00
28e5f1ca6e pulsensor: Adding doxygen comments and image from adafruit website
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 12:22:06 -07:00
3707e359f4 rfr359f: Adding doxygen comments and image from seeed wiki
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 12:12:03 -07:00
3b4e9da7c6 rotaryencoder: Adding doxygen comments and image from seeed wiki
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 12:03:33 -07:00
6a315f817d rpr220: doxygen comments and adding image from seeed wiki
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 11:52:38 -07:00
d70eef06ac es0a: doxygen comments and adding image from seeed wiki site
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 11:18:07 -07:00
34a55d7eae servo: doxygen comments and adding mfg to upm.h
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-14 11:15:05 -07:00
83344a63c5 doxygen: renamed 'Modules' to 'Libraries'
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 17:53:52 -07:00
6dd8358d2f doxygen: fixed relative path to doxygenlayout.xml
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 17:29:01 -07:00
a5048d20fd grove: updated and added headers with tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 17:28:29 -07:00
d2bdb8836c i2clcd: updated headers with tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 17:24:40 -07:00
35df0fa9d7 lsm303: updated header with tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 17:00:27 -07:00
4b47f6e84b lpd8806: updated header with tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 16:59:52 -07:00
f47bc7e5a7 lol: updated header with tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 13:39:09 -07:00
edcedae0e4 ldt0028: updated header with tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 13:17:01 -07:00
9ebe68ec0c l298: updated header with tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 13:07:08 -07:00
18c21f0bc7 joystick12: updated header with tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 12:55:23 -07:00
d7a389a358 ina132: updated header with tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 12:24:33 -07:00
44f866f924 hx711: swapped example with image for consistency
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 12:12:58 -07:00
17ecaf522a htu21d: updated header with tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 12:11:29 -07:00
6428f43599 hmtrp: updated header with tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 12:04:54 -07:00
e714b0eb24 hcsr04: updated header with tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-13 11:39:10 -07:00
0963b5e140 guvas12d: header updated with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-10 15:00:44 -07:00
76a81c09f2 grovewater: header updated with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-10 14:49:32 -07:00
a2e7609263 grovevdiv: header updated with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-10 14:49:01 -07:00
1e45d8e712 grovespeaker: header updated with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-10 14:33:34 -07:00
d932fa606f groveo2: header updated with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-10 14:29:59 -07:00
c5b86d3637 grovemoisture: header updated with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 17:34:46 -07:00
1e49c43e7a groveloudness: header updated with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 17:01:55 -07:00
82a0d4b6b0 grovelinefinder: header updated with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 16:58:24 -07:00
687f0188ca grovegsr: header updated with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 16:58:11 -07:00
3a989a5ed3 groveelectromagnet: header updated with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 16:57:15 -07:00
728e01c582 groveemg: header updated with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 15:19:46 -07:00
f98a257ed5 groveeldriver: header updated with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 15:09:08 -07:00
d827e58997 groveehr: header updated with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 15:06:46 -07:00
8d931fbf74 grovecollision: header updated with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 15:00:19 -07:00
5b4edc8631 gp2y0a: header fix for new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 13:25:29 -07:00
90019cdc62 gas: header updates with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 13:22:16 -07:00
cdfdbc3678 flex: header fixes for tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 13:22:12 -07:00
b218d01248 enc03r: header update
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 13:22:09 -07:00
dec2e8eacc ecs1030: header update
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 13:22:04 -07:00
9b3befd6f2 ds1307: header update
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 13:22:01 -07:00
b243290a36 cjq4435: header update
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 13:21:57 -07:00
1cf3f43db0 buzzer: header update
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 13:21:54 -07:00
090035bf1d bmpx8x: header update
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 13:21:52 -07:00
77be6adf6d gp2y0a: renamed from gp2y0a21yk to indicate support for the gp2y0a family
Additionally, add some error checking in the constructor, and determine
the ADC resolution and use that in the voltage calculation rather than
a hardcoded 1024.0.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-09 13:18:59 -07:00
828d3b928e tm1637: brand new working implementation
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-08 16:19:33 -07:00
1d0284abaf CMakeLists.txt: removed duplicate entries
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-01 10:33:38 -07:00
8f2238835e waterlevel: initial implementation
The library implements support for the grove water level switch.

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-01 10:10:24 -07:00
ca506f9fab apds9002: initial implementation
This library implements support for the apds9002 luminance sensor.

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-01 10:10:07 -07:00
56a01322b5 mhz16: Initial implementation
This library implements support for the MHZ16 CO2 sensor.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-01 10:03:58 -07:00
4bb077e70b a110x: Add interrupt support and a suitable example
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-01 10:02:37 -07:00
317ad35180 flex: initial implementation
Implements the flex analog sensor.  See
http://bildr.org/2012/11/flex-sensor-arduino/
for wiring instructions.

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-04-01 10:02:20 -07:00
e3ba0d7b0a docs: fixed the other tags for at42qt1070 and grovemd
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-30 17:04:58 -07:00
c46dc401d4 docs: fixed library tags for at42qt1070 and grovemd
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-30 16:27:37 -07:00
78baaa9dc1 grovemd: added missing @library tag
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-27 10:14:34 -07:00
4a80a216c7 tm1637: Removing from upm due to possible derivation from lgpl code.
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-26 10:42:36 -07:00
b1fa94f1e3 docs: updated signoff info, authors need to do so too, always
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-25 17:15:27 -07:00
4e89284a37 doxy: added alias for @web tab
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-25 17:14:56 -07:00
72c957e700 hx711: updated sensor block and formatting
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-25 15:15:01 -07:00
df302ff5db hx711: Initial implementation HX711 24bit ADC module
Signed-off-by: Rafael Neri <rafael.neri@gmail.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-25 15:14:27 -07:00
bffecdae89 docs: updated tag comname as per standards
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-25 09:41:31 -07:00
07b904e8f1 docs: updated contributions.md with LGPL no longer accepted
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-24 11:46:01 -07:00
dcccf2d0c8 adafruitms1438: Link against CMake target
Instead of trying to call out the build environment for a .so to link
against, use the one UPM will build as a dependency.

Also add guards around the SWIG commands for both Node and Python
targets

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-23 11:53:23 -07:00
ae83074f6f adafruitms1438: use proper python libs when linking python target
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-23 11:52:40 -07:00
5fac6e9811 adafruitms1438: Initial implementation
The library implements support for the Adafruit MotorShield 1438:
http://www.adafruit.com/products/1438

This shield supports 4 DC motors or 2 Stepper motors.

It makes use of the pca9685 UPM library, and therefore requires that
PR #123 and PR #134 are merged first:

PR 123: pkgconfig.in: allow a module to specify dependencies on
another module

PR 134: pca9685: Initial implementation

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-23 11:51:49 -07:00
8ece990ce9 biss0001: updated header with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 17:08:09 -07:00
8ba8890887 am2315: updated header with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 17:08:06 -07:00
02147dfe4b adis16448: updated header and example with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 17:08:03 -07:00
9544b7789d adc121c021: updated header with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 17:07:59 -07:00
6ee89da4ba adafruitss: updated header with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 17:07:56 -07:00
2203d0b906 a110x: updated header with new tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 17:07:53 -07:00
ec067857c5 sm130.h: adding doxygen tags
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-20 18:05:07 -07:00
5b6b7c479a st7735.h: adding doxygen tags
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-20 18:05:06 -07:00
49d5c2de34 stepmotor.h: adding doxygen tags
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-20 18:05:05 -07:00
7f30553a51 ta12200.h: adding doxygen tags
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-20 18:05:05 -07:00
1e7f1f7cf2 tcs3414cs.h: adding doxygen tags
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-20 18:05:03 -07:00
af1acd6be7 th02.h: adding doxygen tags
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-20 18:05:03 -07:00
8388a2867a tm1637.h: adding doxygen tags
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-20 18:05:02 -07:00
55c8ec0395 tsl2561.h: adding doxygen tags
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-20 18:05:01 -07:00
7bb661d31b ttp223.h: adding doxygen tags
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-20 18:05:00 -07:00
816a3055f4 ublox6.h: adding doxygen tags
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-20 18:04:59 -07:00
fa4dabf173 wt5001.h: adding doxygen tags
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-20 18:04:58 -07:00
5c16dd44a7 yg1006: adding doxygen tags
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-20 18:04:57 -07:00
9f12002d7a examples: removed extra interesting tags from file
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 14:36:29 -07:00
e54d48f407 nrf8001: documentation updates and showing relation to aci lib
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 14:34:23 -07:00
f53d8e79cc adafruitss: renamed to adafruit pca9685 servo shield
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 14:29:27 -07:00
2725342c19 pca9685ss: Initial implementation
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 14:29:22 -07:00
ff55f641a2 documentation.md: Add details of what code files to put sensor block comments
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-20 14:30:46 -07:00
e1648d7ec7 Revert "adafruitms1438: Initial implementation"
This reverts commit da0071ae71.

Conflicts:
	examples/c++/CMakeLists.txt

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 12:47:03 -07:00
fd028e2f05 docs: created separate folder for doxygen config files
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 11:35:37 -07:00
3834b92c51 docs: cleaned up top level folder
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 11:35:31 -07:00
1792eb9cfe docs: added optional @web tag for sensor links
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 11:35:27 -07:00
fbbf56a49d groveeldriver: initial implementation
This module implements support for the Grove EL Driver.

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-20 11:09:32 -07:00
da0071ae71 adafruitms1438: Initial implementation
The library implements support for the Adafruit MotorShield 1438:
http://www.adafruit.com/products/1438

This shield supports 4 DC motors or 2 Stepper motors.

It makes use of the pca9685 UPM library, and therefore requires that
PR #123 and PR #134 are merged first:

PR 123: pkgconfig.in: allow a module to specify dependencies on
another module

PR 134: pca9685: Initial implementation

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-19 16:46:40 -07:00
2aa24162c3 pca9685: Initial implementation
This library implements generic support for the pca9685 16 channel 12
bit PWM LED controller.  This controller is used on some Adafruit
motor shields.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-19 16:17:33 -07:00
970d6a083f grovemd: allow seperate directions for each DC motor
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-19 15:09:28 -07:00
d380658b40 grovemd: Initial implementation
This module implements support for the Grove I2C Motor Driver.

The device *requires* a 100Khz I2C bus speed.  It will not work on
anything faster.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-19 15:07:39 -07:00
de66c8de56 at42qt1070: Initial implementation
This module implementes support for the Grove QTouch sensor.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-17 17:35:41 -07:00
518d80cdcd l298: Initial implementation
This was tested on the RobotBase Dual H-Bridge motor control board.

There are two examples:

l298-example: This example demonstrates using the class to contol one
of the H-Brdges to control a DC motor.

l298-stepper-example: This example demonstrates using the class to
control a 4-wire dual-phase stepper motor.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-17 17:04:43 -07:00
925260a234 ina132: initial implementation
This module was tested with the Grove Differential Amplifier, with a
weight sensor attached.

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-17 14:34:51 -07:00
276ba67583 grovegsr: initial implementation
This module implements support for the Grove GSR (Galvanic Skin
Response) sensor.

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-17 14:28:27 -07:00
eeb370556f naming.md: Added rule to use lower case files and folders only
Currently files and folders are all lower case.  Doxygen also
has a tag set to disallow files and folders with upper case
names.  Added an item on the naming.md page which states
only lower case names should be used for files and folders.

Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-17 13:39:51 -07:00
db021fa970 groveo2: initial implementation
This implements support for the Grove O2 (oxygen) sensor.

Keeping with the current convention, as well as the current
config Doxygen uses disallowing uppercase names, this sensor
has been renamed from groveO2 to groveo2 for both files and
folders.

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-17 13:08:38 -07:00
2bffccf839 groveemg: initial implementation
The implements support for the Grove EMG detector.

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-17 10:47:00 -07:00
ce6cd0a19f groveelectromagnet: Initial implementation
This module implements support for the Grove Electromagnet.

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-16 15:44:35 -07:00
ae10518a0f grovecollision: initial implementation
This implements support for the Grove Collision Sensor.

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-16 15:32:46 -07:00
5f3b88b00a adis16448: initial implementation
Signed-off-by: Juan J Chong juanjchong@gmail.com
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-16 14:39:53 -07:00
49ce602808 contributions.md: clarify some details about making a contribution to UPM
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-03-16 12:13:03 -07:00
e2b3cbc0f1 examples: added missing snippets and paired them with right examples
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-13 17:05:12 -07:00
dc932b61e7 examples: updated filenames and snippets to start with chipid
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-13 16:50:18 -07:00
577894851b examples: fixed snippet tag to filename mismatch
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-13 13:34:41 -07:00
6fe96b2195 docs: building.md how to build with all options on
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-12 15:28:12 -07:00
8f969d42f4 docs: updated headers for a few sensors as example
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-11 17:18:49 -07:00
10d1975bc2 docs: prevented doxygen tag name clash and added aliases
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-10 17:11:24 -07:00
0aa3d59487 buzzer: fixed sounds not stopping and added extra functions
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-09 16:30:46 -07:00
3810e7f2cb pkgconfig.in: allow a module to specify dependencies on another module
This patch adds the

Requires: @reqlibname@

and

Requires.private: @reqplibname@

clauses to the src/pkgconfig.in file.

This allows a UPM module to declare a dependency on another module
with a line of the form:

set (reqlibname "upm-somelib")
and/or
set (reqplibname "upm-somelib")

to the CMakeLists.txt file.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-09 16:25:24 -07:00
92615f0637 bmpx8x: fix comments so documentation works properly
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-09 16:08:34 -07:00
23e47fa3b9 bmpx8x: rename gy65 to bmpx8x to more properly reflect supported chips
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-09 16:07:17 -07:00
f0dd5f9530 docs: updated documentation.md with more details
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-06 17:53:11 -08:00
afd560ccdc examples: moved examples to new c++ subfolder
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-05 12:32:34 -08:00
74f00c8a55 i2clcd: added uint8 typemap for python
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-05 12:23:11 -08:00
f50ab24bb3 jhd1313m1: Remove unused variable from Jhd1313m1:write()
Signed-off-by: Clark Scheff <clark@scheffsblend.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-05 11:51:44 -08:00
7bd7e80b2e i2clcd: Add createChar method
LCDs based on the HD44780 allow for setting 8 custom characters.
This patch adds a method that exposes this capability.

Signed-off-by: Clark Scheff <clark@scheffsblend.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-05 11:50:12 -08:00
27a3a90d1f docs: added more info to building.md
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-04 14:50:33 -08:00
b4c265005f docs: few touch ups and typos fixed
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-04 11:26:23 -08:00
9dcef6d7bb docs: created new documentation.md
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-02 11:59:03 -08:00
2ff5dc16aa docs: added sensor categories to upm.h
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-02 09:43:52 -08:00
15ee2dd0ff docs: updated readme.md
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-03-02 09:42:02 -08:00
f13216752e otp538u: Initial implementation
This module was tested on the Grove non-contact IR Temperature
Sensor.  The tables included are only valid for a distance of 9cm.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-02-25 09:29:39 -08:00
1f3d074261 nunchuck: Initial implementation
This was tested with the Grove Nunchuck adapter.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-02-25 09:21:43 -08:00
780500ac0a hmtrp: Add proper @defgroup documentation tag
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-02-25 09:12:16 -08:00
fab4c26238 hmtrp: Initial implementation
This was tested on the Grove Serial RF Pro.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-02-25 09:11:54 -08:00
fad4accfcc adxl335: Add proper @defgroup documentation tag
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-02-24 19:22:11 -08:00
b03676222c adxl335: Initial implementation
The was tested with the Grove 3-Axis Analog Gyro.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-02-24 19:21:54 -08:00
db7d6d7f5f cjq4435: Add proper @defgroup documentation tag
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-02-24 19:00:16 -08:00
6a0a7b6159 cjq4435: Initial implementation
This module was tested on the Grove MOSFET.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-02-24 19:00:01 -08:00
0ebb7e0417 mma7660: Add proper @defgroup documentation tag
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-02-24 17:59:51 -08:00
44b9ce2bdf mma7660: modify JS example to avoid coredumps when run for awhile
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-02-24 17:59:16 -08:00
12c290de70 mma7660: Initial implementation
This was tested on the Grove I2C 3-axis digital accelerometer.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-02-24 17:58:45 -08:00
e0e9405634 Fix Servo library so that it correctly moves to the given angle.
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-02-24 11:34:08 -08:00
73be07df74 upm: new upm.i JS interface file with code to call v8 garbage collector
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-02-19 17:22:07 -08:00
b25cecd315 upm: require correct MRAA version
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-02-19 13:06:04 -08:00
0b9407356d upm: update to version 0.1.9
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-02-10 12:12:13 -08:00
d5cccba5d1 email: e-mail address update in src and examples
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-02-10 11:54:44 -08:00
cb353600ec jhd1313m: write function fix for lost chars
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-02-10 11:09:52 -08:00
995734642e mic: swig python interface changes and python example
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-01-29 17:08:40 -08:00
aaaee7e422 nrf8001: Changing comment style to /**< comment */
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-01-29 17:05:52 -08:00
025ce478be nrf8001: Doxygen documentation warning fixes
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-01-29 17:05:09 -08:00
da321e43f5 pulsensor: Doxygen documentation warning fixes
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-01-29 17:00:29 -08:00
ae7b2ad04f rpr220: Initial implementation
The module implements the RPR220 IR Reflective Sensor.  It was tested
with the Grove IR Reflective Sensor.

It includes 2 examples: rpr220.cxx, demonstrating the simple use case
of querying the current status.

rpr220-intr.cxx demonstrates the use of this class to register an
Interrupt Service Routine (ISR) to count transitions, which might be
more appropriate for some use cases, such as measuring RPM's.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-01-29 16:57:09 -08:00
06b48d8e07 wt5001: update JavaScript example to match new driver and C++ example
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-01-29 16:54:06 -08:00
328b7638ad wt5001: switch to using new mraa_uart_get_dev_path()
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-01-29 16:50:28 -08:00
809292630f ublox6: switch to using new mraa_uart_get_dev_path()
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-01-29 16:42:07 -08:00
fec3f22765 adc121c021: Updated JavaScript example for adc121c021 I2C ADC sensor
This patch fixes the JS example to be more like the C++ example.

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-01-29 16:26:45 -08:00
a665b5d6f1 cmake: allows to build in source tree by filtering subdirs
Without it FTBFS and displays this error message :

  cmake . && make
  (...)
  The source directory
  (...) src/CMakeFiles
  does not contain a CMakeLists.txt file.

Change-Id: I08efc4667d1004a5d19575dd4464dcd89d03fb28
Bug: https://github.com/intel-iot-devkit/upm/pull/75
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-01-29 16:22:52 -08:00
ba33366d45 build: warn about building into sources' dir
If you build in the source tree, you'll fill the sources with objects and create a mess.
Please prefer to build outside sources tree into a temporary place,

prefer :
   cmake build

to :
   cmake .

But If you trust your build tools and cleanup is done on each build
you can use current dir without any risk.

Bug: https://github.com/intel-iot-devkit/upm/pull/75
Change-Id: Ieb914ca359047df8b5dba1c2174e6c61e4526677
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-01-29 16:22:12 -08:00
c9792b4e62 hmc5883l: added py example
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-01-29 16:13:20 -08:00
de342a5502 hmc5883l: modified py interface to support arrays
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-01-29 16:02:52 -08:00
a4e590ae3a adxl345: Grove 3-Axis Accelerometer
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-01-23 17:58:29 -08:00
6aef5868af es08a: Move servo.js example to use es08a class
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-23 17:39:18 -08:00
a8b85ff93b itg3200: python sample
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-23 17:14:36 -08:00
e0bdba5478 itg3200: swig python additins for int16_t * support
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-23 17:14:34 -08:00
09659c62f3 es08a: Add output to python example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-22 20:12:02 -08:00
de70ed8694 servo: Modified output of JavaScript example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-22 20:12:01 -08:00
2fce7369f4 es08a: Add comments, output, and one-second sleeps to C++ example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-22 20:11:53 -08:00
47c79086f2 servo: Remove extraneous output from routine
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-22 20:09:03 -08:00
951f0e0866 servo: Improved documentation for es08a class
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-22 20:08:11 -08:00
d9cc2812c4 servo: Improved documentation for servo
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-22 20:07:19 -08:00
2886e6946f buzzer: Python example for buzzer
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-20 16:50:32 -08:00
02829cf43d buzzer: Modify comments in C++ example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-20 16:50:23 -08:00
ddf32f9cb7 buzzer: documentation fixes
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-20 16:26:03 -08:00
063abf7163 buzzer: remove extraneous output from destructor
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-20 16:26:02 -08:00
6f19f28add Fixing the comment for which plug the servo should be in
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-20 11:57:27 -08:00
90079b8d10 es08a: Python example for es08a servo
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-20 11:04:41 -08:00
5832f4e3b7 itg3200: JavaScript example file itg3200 3-axis digital gyroscope
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-19 17:34:16 -08:00
12ecd6fa14 itg3200: Modifications to js swig file
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-19 17:34:15 -08:00
092a455172 carrays_float.i: Add new file for float type
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-19 17:34:12 -08:00
d307376abc rotaryencoder: Initial implementation
This module implements supoort for the Grove Rotary Encoder, though it
should function with any Rotary Encoder utilizing two GPIOs.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-19 15:08:38 -08:00
6135e932e4 grove_mcfled: Add C++ and JS examples, utilizing existing GroveLed driver.
The module adds examples that utilize the existing GroveLed driver for
the Grove Multi Color Flash LED.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-19 14:41:23 -08:00
a853733f61 my9221: Add C++ and JS examples
These were tested on the Grove LED Bar.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-19 14:05:39 -08:00
e005ec4624 mq9: JavaScript example, with appropriate SWIG typemap
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-19 13:39:19 -08:00
11d5d6f424 mq5: JavaScript example, with appropriate SWIG typemap
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-19 13:31:43 -08:00
5448e72975 Initial implementation of Grove PIR motion sensor with BISS0001 chip
jrvandr: removed unnecessary mraa_init()

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-19 13:19:12 -08:00
9cda72b077 mq3: Add comments to C++ example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-19 12:12:43 -08:00
30989d9b7c mq3: JavaScript example
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-19 12:12:25 -08:00
93e0100049 mq2: Add comments to C++ example for mq2 gas sensor
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-19 11:54:11 -08:00
d269b3200d mq2: JavaScript example for mq2 gas sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-19 11:54:10 -08:00
7c41db4c83 gas: Modifications to js swig file to use appropriate SWIG typemap
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-19 11:54:03 -08:00
6642ee9eef rfr359f: Initial implementation
This was tested on the Grove IR Distance Interrupter.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-19 10:05:18 -08:00
db1ca3d08a grovespeaker: Initial implementation of Grove Speaker
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-18 00:26:31 -08:00
1ac1760691 ppd42ns: glibc < 2.17 need to link to lrt to use clock_gettime()
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-17 21:55:22 -08:00
4bae8bfa20 cmake: add argument to add linker flags in upm_module_init macro
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-17 21:55:08 -08:00
121caf0829 ppd42ns: Move dustData to upm namespace
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-17 21:54:54 -08:00
3494bd2008 building.md: fix clang/clang++ arg
Whilst most versions of clang autodetect whether the code is C or C++ it seems
more recent versions do not do this correctly. Fix the doc to make sure this
works all the time

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-17 21:54:06 -08:00
509cc3a6d3 mq303a: Initial implementation of the mq303a alcohol sensor
The module implements support for the mq303a alcohol sensor.  It was
tested on the Grove Alcohol Sensor.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-16 17:29:44 -08:00
7d40425391 ppd42ns: Initial implementation of the Grove dust sensor
jrvandr: removed unnecessary mraa_init()

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-16 17:19:39 -08:00
df390358f2 wt5001: Initial implementation
The module implements support for the WT5001 serial mp3 player.  It was
tested on the Grove Serial MP3 Player.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-16 16:50:16 -08:00
40e0595892 yg1006: Initial implementation
This module implements support for the yg1006 flame sensor.  It was
tested with the Grove Flame Sensor.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-16 16:00:41 -08:00
f53fab80fd ublox6: Initial implementation
jrvandr: removed unnecessary mraa_init() and mraa_deinit()

The module implements support for the ublox-6 GPS sensor.  It was
tested on a Grove GPS device.

This module simply allows data to be retrieved from the device in the
form of NMEA sentences, and provides a method to write commands to the
device for configuration purposes.

It does not attempt to parse NMEA data -- that is a project in itself.
There are libraries available on the Internet, such as tinyGPS++ that
can handle that for you.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-16 14:06:56 -08:00
0c63500b36 mpr121: Initial implementation
This module implements support for the Grove I2C touch sensor
(mpr121).

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-16 13:19:02 -08:00
2eb0047643 groveloudness: Initial implementation
This module implements support for the Grove Loudness sensor.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-16 12:43:49 -08:00
38a14eb068 guvas12d: Initial implementation
jrvandr: removing unnecessary mraa_init()

This module implements support for the Grove UV sensor (guvas12d).

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-16 12:27:39 -08:00
9784f6e6ab grovewater: Initial implementation
jrvandr: removing unecessary mraa_init()

This module implements support for the Grove Water sensor.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-16 12:14:58 -08:00
8d3e29a695 grovevdiv: Initial implementation
This module implements support for the Grove Voltage Divider.
jrvandr: Removed unecessary mraa_init() from grovevdiv.cxx

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-16 11:50:54 -08:00
fb2fbbd95e grovelinefinder: Initial implementation
This module adds support for the Grove Line Finder sensor.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-16 11:00:27 -08:00
2aa6610645 tcs3414cs: Show the example code snippet in the documentation
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-16 10:44:30 -08:00
69754c283f tcs3414cs: Add comments to C++ example for the Grove color sensor
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-16 10:44:29 -08:00
99700d7d1f tcs3414cs: JavaScript file for the Grove color sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-16 10:44:28 -08:00
29adee8435 tsl2561: JavaScript file for the Grove digital light sensor
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: John Van Drasek <john.r.van.drasek@intel.com>
2015-01-16 10:22:11 -08:00
1812e214df ssd1327: JavaScript example for ssd1327 OLED display
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 18:38:54 -08:00
d9130671d7 ssd1327: Modifications to js swig file
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 18:38:53 -08:00
6c6c16256b carrays_uint8_t.i: Add new file for uint8 type
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 18:38:44 -08:00
07c3bf5f25 ssd1327: Modifying C++ example
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 18:14:26 -08:00
19caf37088 lsm303: JavaScript example for Grove 6-axis accelerometer
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 17:54:28 -08:00
405dab1725 lsm303: Modifications to js swig file
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 17:54:26 -08:00
9d48301402 lsm303: Modifying C++ example
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 17:54:17 -08:00
83e2b3f800 joystick12: Add comments to C++ example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 16:51:39 -08:00
86cd7771cd joystick12: JavaScript example for the Grove joystick
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 16:51:38 -08:00
ee59c17081 Merge branch 'jrvandr-2014-01-15-pr68' js servo example 2015-01-15 16:24:02 -08:00
3544e4b2ad Merge branch 'pull_js_servo' of https://github.com/Jon-ICS/upm into jrvandr-2014-01-15-pr68 2015-01-15 16:22:50 -08:00
4dc4461004 hmc5883l: Add comments to C++ example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 15:30:57 -08:00
fb8dd8ad85 hmc5883l: JavaScript example file for hmc5883l 3-axis compass
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 15:30:57 -08:00
f00de88f97 hmc5883l: Modifications to js swig file
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 15:30:56 -08:00
496cd1c632 carrays_int16_t.i: Add new file for int16_t type
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 15:30:55 -08:00
6a4c27841d carrays_uint16_t.i: Added comments
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 15:30:54 -08:00
8ed6dc60a5 gy65: Add comments to C++ example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 13:39:57 -08:00
a70ca3b70d gy65: JavaScript example for gy65 barometer
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 13:36:15 -08:00
4333869b7b ta12200: Initial implementation; Grove Electricity uses this sensor
[renamed from] groveelectricity: Initial implementation

This module adds support for the Grove Electricity sensor.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-15 13:11:25 -08:00
ed15b1042d groveehr: Initial implementation
This module implements support for the Grove Ear-clip heart rate
sensor.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-14 17:24:42 -08:00
6e8b0dd038 mic: Add comments to C++ example for Grove microphone/sound sensor
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-14 16:50:29 -08:00
2a8bbb0b8c microphone: JavaScript example for Grove microphone
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-14 16:45:32 -08:00
0ef81a3b1c grovemoisture: Initial UPM implementation
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-13 16:30:21 -08:00
2d1ff0e318 gp2y0a21yk: Initial implementation of the gp2y0a21yk 80cm IR proximity sensor
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-13 15:20:51 -08:00
0b7547231f a110x: Initial implementation
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-13 13:29:08 -08:00
02156d11c8 ds1307: initial implementation of the ds1307 RTC
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-13 13:01:29 -08:00
66d39af6c5 lcd: JavaScript example for RGB LCD in Grove starter kit
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-13 10:35:58 -08:00
98f26235db buzzer: JavaScript example for Grove buzzer
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-12 19:00:36 -08:00
878ca55385 adc121c021: Initial implementation
Tested on the Grove I2C ADC.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-12 17:18:00 -08:00
27ccb57987 grove servo: JavaScript example for servo motor in Grove starter kit
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2015-01-12 15:44:24 -07:00
eca9ed95c8 grove: added GroveRelay class for Grove Relay
Signed-off-by: Alexandru Radovici <alexandru.radovici@wyliodrin.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-09 18:17:58 -08:00
a1620271f2 enc03r: Initial implementation
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-09 16:42:01 -08:00
df4706e3b1 ttp223: Grove touch sensor and examples
Added support for the TTP223 touch detector-based sensors
(like the Grove touch sensor) with corresponding examples
in C++, JavaScript, and Python.

Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-08 14:57:38 -08:00
811b33936b grove: add Grove LED Python example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-08 14:27:34 -08:00
09248d4dc4 grove: add Grove LED JavaScript example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-08 14:27:33 -08:00
535230084e grove: added comments to Grove LED C++ example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-08 14:27:32 -08:00
49d25b1791 grove: modify Grove LED documentation
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-08 14:27:31 -08:00
42cde580bf grove: updated description of Grove light sensor
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-07 15:58:16 -08:00
c170b01fc2 grove: add missing light sensor example to examples/CMakeLists.txt
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
2015-01-07 15:56:31 -08:00
0a8f46a506 am2315: Updated code to use mraa_set_priority
Signed-off-by: William Penner <william.penner@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-06 18:38:13 +00:00
be8336d0e8 itg3200: Grove 3-axis Gyroscope
Signed-off-by: Mihai Tudor Panu <mihai.t.panu@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-06 18:37:24 +00:00
03cca53d2a am2315: Sensor added
Signed-off-by: William Penner <william.penner@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-19 22:33:20 +00:00
da50225566 contributing.md: Add developer certificate of origin stuff
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-15 16:23:59 +00:00
c3d5b95576 grove.h: Improve docstrings on GroveTemp
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-04 10:59:17 +00:00
39e6065046 grovetemp.cxx: Improve C++ example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-04 10:59:02 +00:00
237f9cc36d grovetemp.py: Improve example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-04 10:58:04 +00:00
40172142b3 grovetemp.js: add example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-04 10:57:15 +00:00
5bbdc148c6 grove.cxx: Improve GroveTemp formula
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-04 10:54:48 +00:00
751b0f1fe0 grove: improve docstrings
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-04 10:41:46 +00:00
a1abab8909 grovelight.cxx: improve example code
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-04 10:40:56 +00:00
0ff9c7afcc examples: add python & nodejs GroveLight examples
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-04 10:39:20 +00:00
6fa68db79f grove.cxx: change lux formula used in GroveLight
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-04 10:37:38 +00:00
8504830c52 CMakeLists.txt: use relative paths for install
Using CMAKE_INSTALL_FULL_LIBDIR breaks cpack

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-02 17:58:07 +00:00
cb37c87467 cmake : Define library suffix in case of 64 bits multilib archs in linux
Install library using cmake defined library directories. Install python
packages using cmake defined library directories

Signed-off-by: Helio Chisisni de Castro <helio@kde.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-02 17:14:29 +00:00
e04a6fbcaa tp401: added sensor to readme
Signed-off-by: Mihai Tudor Panu <mihai.t.panu@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-02 16:35:55 +00:00
2a743df91d package.json.in: Proper version requires for nodejs
Signed-off-by: Helio Chisisni de Castro <helio@kde.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-02 16:33:49 +00:00
fc8374fe5e doxy2swig: fix runtime issue because off missing unicode encode
Fixes #14

Signed-off-by: Mihai Tudor Panu <mihai.t.panu@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-27 09:31:58 +00:00
0bc2f04b4e grovetsl2561.jpeg: remove exec permissions on file
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-26 17:37:57 +00:00
7bb5fd8ec7 tp401: grove air quality sensor and examples
Signed-off-by: Mihai Tudor Panu <mihai.t.panu@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-26 17:37:23 +00:00
801209678b grove: add grove button support and examples
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-26 17:01:10 +00:00
c5369315e9 ldt0028: Added support for LDT0-028 PZT film-based sensors
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-25 20:42:13 +00:00
931c8e8814 gas: fixed documentation typos and updated images
Signed-off-by: Mihai Tudor Panu <mihai.t.panu@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-25 20:39:49 +00:00
c34939cfb4 mpl3115a2: sensor added
Signed-off-by: William Penner <william.penner@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-25 20:37:14 +00:00
ce928907eb htu21d: update to correct code now under MIT license
Signed-off-by: William Penner <william.penner@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-25 20:35:46 +00:00
b53881a8d6 htu21d: sensor added
Signed-off-by: William Penner <william.penner@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-21 16:52:08 +00:00
9ab215b6fd hmc5883l: use int16_t as coordinate type throughout
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-19 11:57:35 +00:00
ea7b7a23fa hmc5883l: changed to standard heading and added declination
Signed-off-by: Mihai Tudor Panu <mihai.t.panu@intel.com>
2014-11-14 12:57:08 -08:00
03318b3c4d hmc5883l: fixed type cast in update()
Signed-off-by: Mihai Tudor Panu <mihai.t.panu@intel.com>
2014-11-14 11:04:32 -08:00
726e40d6c5 max5487: fix optional parameter in constructor
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-13 16:38:35 +00:00
e3bdef0ef0 lol: styling fix and remove static gpio tables for gen1
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-13 16:02:53 +00:00
8174b6c59b lol.h: remove unimplemented function
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-13 16:00:48 +00:00
474a6f82a3 mic.h: update link to example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-13 15:57:49 +00:00
cebc339d91 grove: sliding potentiometer
Signed-off-by: Mihai Tudor Panu <mihai.t.panu@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-12 17:20:06 +00:00
b2ffcdd9ea grove: rotary angle sensor
Signed-off-by: Mihai Tudor Panu <mihai.t.panu@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-12 17:18:12 +00:00
e91b69230c tsl2561.cxx: remove exec perms
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-12 17:00:45 +00:00
5477321ce7 tsl2561: fix indentation of example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-12 15:19:17 +00:00
ac9cd1afa3 tsl2561: update example to use new API
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-12 15:18:33 +00:00
96a8bf7e06 tsl2561: change getLux calls to return an int
To follow with our simple API requirements, change the return value of getLux()
call to an int. This lets SWIG do a better job with generating an API

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-12 15:15:02 +00:00
2ea12da8b8 tsl2561: fix indentation, style and namespace
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-12 15:13:44 +00:00
685adc561b tsl2561: remove executable permissions on files
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-12 15:12:25 +00:00
fd54745cc0 lsm303: fix types returned by module and heading formula
* getRawAccelData() & other accel functions now return int16_t
* scale is now a supported constructor parameter
* heading returns 0-360 values

Signed-off-by: Mccool, Michael <michael.mccool@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-10 09:25:28 +00:00
4bf30df933 building.md: update cmake instructions
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-09 12:25:48 +00:00
44b1ff7f75 lsm303: make code alot more robust and fix getHeading() call
Note that from this UPM release libmraa 0.5.2+ is required

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-07 10:54:12 +00:00
e9da4719fb tsl2561: light to digital sensor tsl2561
Signed-off-by: Nandkishor <nandkishor.sonar@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-05 17:28:25 +00:00
fc776ba3a3 jhd1313m1.h: add warning to show it only works with 5V
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-05 13:54:31 +00:00
8e11768a51 naming.md: update documentation for naming
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-04 23:41:46 +00:00
3bea0233bc gas: remove thresholdContext param from getSample()
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-04 19:13:21 +00:00
b1da85f437 servo: fix js & python wrappers by adding base class to interaface
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-10-09 18:45:12 +01:00
875c39ab85 TODO: update public todo list
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-10-02 10:29:14 +01:00
397af51d7c upm: Add sensor groups based on IO types
This commit also fixes adds some default constructor arguments to some i2c
sensors.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-10-02 10:28:29 +01:00
79e8a261ba grove.h: add documentation to aio grove sensors
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-10-02 09:55:13 +01:00
da59216663 grove.cxx: fix with 10bit ADC numbers
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-27 07:14:39 +01:00
13814f78d8 lpd8806.h: fix typo in example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-25 16:50:19 +01:00
c211f4ba1a doc: add doxygen link to README.md
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-09-23 10:29:18 +01:00
a6b7522b18 gas: add headers to swig files
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-22 17:33:29 +01:00
30ae8070c6 gas: fix example filenames
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-22 17:30:41 +01:00
67d2cb6428 jhd1313m1: add default i2c addresses
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-22 17:26:27 +01:00
a07663045b i2clcd: add ssd1308 to swig and move common files to ssd.h
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-22 17:07:00 +01:00
befba8c18d doxygen: add groups for all modules
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-22 16:37:36 +01:00
e7a32b9882 lsm303: add quick accel data functions
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-18 16:31:58 +01:00
d0999cf778 nrf24l01: changed src and dest address
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-09-10 19:09:13 +00:00
81e1fd281c nrf24l01: added new feature BLE broadcasting with example and new methods to nrf24l01 (setChannel, setPower, etc... )
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-09-10 18:55:16 +00:00
4aa51c0edb grovetemp.py: add example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-10 15:44:15 +01:00
bbb7aa5a39 grove.cxx: drop ADC resolution to 10bit for calculation
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-10 15:44:15 +01:00
d97ce2378b lol: Added Olimex LoL array support, 13x9 LED matrix
Signed-off-by: izard <alexander.komarov@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-09-09 17:54:38 +01:00
d44eb0b751 joystick12: Add Elecfreaks Joystic 1.2/1.4 support
This should also support similar analog joysticks

Signed-off-by: izard <alexander.komarov@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-09-09 17:54:03 +01:00
5f2b525ee4 lsm303: add picture of grove lsm303
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-08 13:59:19 +01:00
af6272941a rgb-lcd.py: add example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-08 13:55:59 +01:00
97bc6bbc20 4digitdisplay.py: add example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-08 13:55:33 +01:00
47c332bf6f examples: fix naming of examples
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-07 21:59:22 +01:00
1d49b4c3f4 lpd8806: fix typo
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-07 21:49:16 +01:00
c1ec85ee81 README.md: add ECS1030 sensor to list
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-07 21:47:07 +01:00
b347f47406 ecs1030: move example and fix doc
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-07 21:44:16 +01:00
d15bf86157 CMakeLists.txt: move required libmraa version to 0.4.5
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-07 20:19:19 +01:00
93a8603686 gy65: add more doc and default constructor settings
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-07 20:11:19 +01:00
0ef50b8be2 hmc5883l: improve documentation and sample
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-07 15:20:04 +01:00
88bf6956fe lsm303: add new sensor, 6-Axis Accelerometer/Compass
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-05 19:00:43 +01:00
961c33ad48 max31855: fix missing interesting tag in header for doc
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-05 17:12:50 +01:00
7580465f6b cpack: add tgz generator
* Used by build system to create copy of compiled assets

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-09-05 15:04:16 +01:00
88eaced5a2 upm: update to version 0.1.8
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-03 09:39:51 +01:00
b8e1b5850c README.md: fix broken links
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-01 15:33:39 +01:00
e3177c260c doc: improve & complete documentation on many sensors
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-01 15:31:55 +01:00
3ed11d7c37 doyxgen: make layout show brief seperately
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-01 10:58:56 +01:00
52198840b8 max5847: add sample
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-01 10:57:48 +01:00
cb9d8e2339 README.md: add list of supported sensors that link to classes
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-29 15:37:11 +01:00
02fb40f058 max5847: improve documentation
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-29 15:35:30 +01:00
cbe211c8cf max5847: work with std chipselect
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-29 15:35:00 +01:00
94a49a8f36 max31723: improve documentation
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-28 18:03:38 +01:00
2aeb9ddea3 Doxygen: add layout file and make formatting more sensible
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-28 18:03:19 +01:00
6d239b9f63 docs: fix warnings in doc creation
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-28 17:59:21 +01:00
ee2d398bfa th02:: added new humidity&temperature sensor
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-07-04 18:01:51 +00:00
50fd1d7478 tcs3414cs:: added new color sensor
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-27 12:40:33 +00:00
e7d811e4df gas:: added README file with MQ-N sensors type
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-26 20:43:52 +00:00
03fa37b130 mq5:: added new sensor
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-26 20:39:58 +00:00
b5066c3d55 mq3:: added new sensor
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-26 20:30:41 +00:00
30187ba5f9 mq2:: added new sensor
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-26 20:23:05 +00:00
4eb6c4e19d mq9:: added new sensor
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-26 19:33:39 +00:00
0ea310ac71 package.json.in: add version to package.json files
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-26 14:17:32 +01:00
5c4de1b926 ecs1030: added new current sensor (works on atmega328 but on Galileo not accurate, need calibration and circuit)
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-25 23:25:11 +00:00
59a66b41bb mlx90614: added new sensor (ir temperature), there is an issue with repeated start bit in i2c thus the sensor return incorrect data
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-20 11:09:31 +00:00
d878a5cf1a upm: update to 0.1.7
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-08-18 16:03:13 +01:00
428f4e5bfc upm: remove flag setting, move node to target only
* Fixes issue with swig and sysroots

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-08-18 15:56:38 +01:00
050c134664 lpd8806: Added new module - digital led strip (NOT TESTED)
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-18 11:21:48 +00:00
ffdd6d2f00 nrf8001: added helloworld example (communicating with nrf UART application
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-13 11:49:33 +00:00
044037b892 nrf8001: added new BLE module with broadcasting example
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-12 23:40:47 +00:00
ad87704c19 grovelight.cxx: add grovelight sample code
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-12 16:53:16 +01:00
00114f69d2 grove: add documentation for grove module
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-11 14:12:23 +01:00
c99821ad26 CMakeLists.txt: fix python builds and doc building
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-11 11:31:32 +01:00
a9939d6352 max31723: use new prefixed spi MODE enum
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-08 09:52:52 +01:00
5ed36a37f9 sm130: fix std::min call having issues with template argument dedudction
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-07 20:38:45 +01:00
03b9cf89a0 CMakeLists.txt: fix builds without swig
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-07 19:23:29 +01:00
9c9b273b5a lcd: overhaul documentation for lcd module
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-07 19:15:49 +01:00
586acf7502 contributions.md: add rules for documentation
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-07 19:15:32 +01:00
d0e83d7076 max31723: made it work with SPI but the data looks like incorrect
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-06 16:41:40 +00:00
1747fbbe19 max5487: added new sensor with example (TESTED AND WORKING)
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-05 20:16:05 +00:00
45f85e9944 max31723 :: added new temperature sensor (HAVE ISSUES WITH SPI)
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-04 18:01:21 +00:00
b31e88c233 maxds3231m :: added working example (set/get date and temperature)
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-04 11:44:07 +00:00
58b80f6b58 maxds3231m :: fix to getTemperature method
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-08-04 12:00:58 +03:00
574a39d3c1 maxds3231m: Added new sensor support get/set data&time and get temperature (NOT TESTED YET)
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-07-31 19:16:23 +03:00
bb38b35b32 sm130: Added new sensor (basic function was implemented and not tested)
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-07-04 15:10:09 +00:00
d15bf22536 Fix some dosctrings errors and trailing whitespaces
Signed-off-by: Kirill Luchikhin <kirill.luchikhin@intel.com>
2014-07-29 21:46:48 +04:00
731704eaac Jhd1313m1: add basic scroll functionality
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-07-14 15:25:12 +01:00
00170bea97 my9221: return mraa_error_t when method says it does
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-07-14 13:59:56 +01:00
8cfb3d3dab my9221: add direction for setBarLevel
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-07-14 13:59:19 +01:00
d2e2682f0e building.md: Adding doc on building a simple example with g++ and using pkg-config
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-07-14 10:55:17 +01:00
22ad93956c building.md: add information to rebuild only one scripting module in doc
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-07-14 10:49:17 +01:00
86a3be4517 jhd1313m1: add setColor method call to control backlight
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-07-14 10:48:55 +01:00
8a67c143bf mic: add carrays for uint16_t as used by mic module
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-07-03 13:42:46 +01:00
7dc8ec6244 oled-1308.cxx: replace Seed logo with Intel logo
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-06-27 04:38:20 +01:00
0d544dadeb make_oled_pic.py: script can transform an image into correct format for oled-13xx displays
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-06-27 04:37:50 +01:00
9f66c10b26 upm.i: add stdint.i to add uinstd typemaps
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-06-26 19:20:10 +01:00
2822d63c9c upm.i: add top level interface file which includes std_string.i
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-06-25 14:16:28 +01:00
848 changed files with 52424 additions and 1506 deletions

View File

@ -1,6 +1,10 @@
cmake_minimum_required (VERSION 2.8.11)
project (upm)
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message("WARNING: building into sources dir can be risky, prefer other directory")
endif ()
find_package (SWIG)
if (SWIG_FOUND)
include (${SWIG_USE_FILE})
@ -9,18 +13,22 @@ endif ()
find_package (Threads REQUIRED)
find_package (PkgConfig REQUIRED)
# force the libmraa version to be the required version
pkg_check_modules (MRAA REQUIRED mraa>=0.4.0)
pkg_check_modules (MRAA REQUIRED mraa>=0.6.0)
message (INFO " found libmraa version: ${MRAA_VERSION}")
# Appends the cmake/modules path to MAKE_MODULE_PATH variable.
set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
set (LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "Installation path for libraries")
# Set CMAKE_LIB_INSTALL_DIR if not defined
include(GNUInstallDirs)
# Make a version file containing the current version from git.
include (GetGitRevisionDescription)
git_describe (VERSION "--tags")
if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND")
message (WARNING " - Install git to compile a production libmraa!")
set (VERSION "v0.1.5-dirty")
set (VERSION "v0.2.0-dirty")
endif ()
message (INFO " - UPM Version ${VERSION}")
@ -53,7 +61,7 @@ if (BUILDDOC)
# add a target to generate API documentation with Doxygen
find_package (Doxygen)
if (DOXYGEN_FOUND)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target (doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
@ -67,7 +75,7 @@ if (IPK)
target_architecture (DETECTED_ARCH)
message( INFO " - Target arch is ${DETECTED_ARCH}")
set(CPACK_GENERATOR "DEB")
set(CPACK_GENERATOR "DEB" "TGZ")
set(OPKG_ARCH ${DETECTED_ARCH})
set(CPACK_BINARY_DIR ${CMAKE_BINARY_DIR})
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Intel IoT-Devkit") #required
@ -90,4 +98,4 @@ if (IPK)
endif()
add_subdirectory (src)
add_subdirectory (examples)
add_subdirectory (examples/c++)

View File

View File

@ -1,12 +1,12 @@
UPM - Sensor/Actuator repository for Mraa
UPM - Sensor/Actuator repository for libmraa
==============
UPM is a high level repository for sensors that use mraa. Each sensor links to
libmraa and are not meant to be interlinked although some groups of sensors may
be. Each sensor contains a header which allows to interface with it. Typically
a sensor is represented as a class and instanciated.
UPM is a high level repository for sensors that use libmraa. Each sensor links
to libmraa and are not meant to be interlinked although some groups of sensors
may be. Each sensor contains a header which allows to interface with it.
Typically a sensor is represented as a class and instantiated.
The constructor is expected to initialise the sensor and paramters may be used
The constructor is expected to initialise the sensor and parameters may be used
to provide identification/pin location on the board.
Typically an update() function will be called in order to get new data from the
@ -14,18 +14,44 @@ sensor in order to reduce load when doing multiple reads to sensor data.
### Example
A sensor/acturo is expected to work as such (here is the servo ES08A api):
A sensor/actuator is expected to work as such (here is the servo ES08A API):
@snippet es08a.cxx Interesting
However implementation and API design is compeltely up to the developer, some
enumerable sensors for example may provide much clever instanciation. Displays
However implementation and API design is completely up to the developer, some
enumerable sensors for example may provide much clever instantiation. Displays
may also create more complex structures in order to interface with them.
Browse through the list of all [examples](https://github.com/intel-iot-devkit/upm/tree/master/examples).
### Supported Sensors
Supported [sensor list](http://iotdk.intel.com/docs/master/upm/modules.html) from API documentation.
You can also refer to the [Intel® IoT Developer Zone](https://software.intel.com/iot/sensors).
### Building UPM
See @ref building
See @ref building [here](docs/building.md).
### Making your own UPM module
@ref porting has more information on making new UPM modules
@ref porting [link](docs/porting.md) has more information on making new UPM modules.
There is also an example available for @ref max31855 [sensor](docs/max31855.md).
### Naming conventions and rules for new UPM contributions
Before you begin development, take a look at our @ref naming [conventions](docs/naming.md).
Also, please read the guidelines for @ref contributions [to UPM](docs/contributions.md).
Don't forget to check the @ref documentation [section](docs/documentation.md).
Make sure you add yourself as an author on every new code file submitted.
If you are providing a fix with significant changes, feel free to add yourself
as a contributor. Signing-off your commits is mandatory.
C/C++ API Documentation
==============
The C/C++ documentation is available [here](http://iotdk.intel.com/docs/master/upm/).

View File

@ -3,7 +3,15 @@ Building UPM {#building}
UPM uses cmake in order to make compilation relatively painless. Cmake runs
build out of tree so the recommended way is to clone from git and make a build/
directory.
directory. Failure to do an out-of-source build may cause issues when
rebuilding later on.
This project depends on libmraa, so that needs to be installed first. Use the
following environment variables to configure the paths:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:.../mraa/build/lib/pkgconfig
CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:.../mraa/build/include
LIBRARY_PATH=$LIBRARY_PATH:.../mraa/build/lib
UPM will attempt to build all directories inside src/ and they must contain
individual CMakeLists.txt files.
@ -15,17 +23,85 @@ cmake ..
make
~~~~~~~~~~~~~
Our cmake configure has a number of options, `cmake -i` will ask you all sorts
of interesting questions, you can disable swig modules, build documentation
etc...
Our cmake configure has a number of options, *cmake-gui* or *ccmake* can show
you all the options. The interesting ones are detailed below:
Few recommended options:
Changing install path from /usr/local to /usr
~~~~~~~~~~~~~
-DCMAKE_INSTALL_PREFIX:PATH=/usr
~~~~~~~~~~~~~
Building debug build:
~~~~~~~~~~~~~
-DCMAKE_BUILD_TYPE=DEBUG
~~~~~~~~~~~~~
Using clang instead of gcc:
-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang
~~~~~~~~~~~~~
-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
~~~~~~~~~~~~~
Cross-compiling on a different system:
~~~~~~~~~~~~~
-DCMAKE_CXX_FLAGS:STRING=-m32 -march=i586
-DCMAKE_C_FLAGS:STRING=-m32 -march=i586
~~~~~~~~~~~~~
Building with an older version of swig (swig 2.0+) requires the disabling of javascript:
~~~~~~~~~~~~~
-DBUILDSWIGNODE=OFF
~~~~~~~~~~~~~
Disabling python module building
~~~~~~~~~~~~~
-DBUILDSWIGPYTHON=OFF
~~~~~~~~~~~~~
Setting the python library to use:
~~~~~~~~~~~~~
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/libpython2.7.so.1.0
~~~~~~~~~~~~~
Building doxygen doc
~~~~~~~~~~~~~
-BUILDDOC=ON
~~~~~~~~~~~~~
If you intend to turn on all the options and build everything at once (C++,
Node, Python and Documentation) you will have to edit the src/doxy2swig.py file
and change the line endings from Windows style to Linux format. This has to be
repeated every time to sync with the master branch since our Github repository
stores files using CR LF line breaks.
You can also generate the include and lib directories containing all the sensor
headers and library files respectively with *make install*. Further, you may
choose to generate these only for a specific sensor you modified, and this can
be achieved by building from the individual makefile of the sensor. Assuming
you're in the build directory, to make the lcd module you would:
~~~~~~~~~~~~~
cd src/lcd
make install
~~~~~~~~~~~~~
Often developers are only interested in building one module or even just the
python/node module to do some quick testing using scripting. In order to do
this you need to use the target name for the python or node module you want to
rebuild. For example the lcd module target name is i2clcd. Therefore the python
module target name will be prefixed by _pyupm_. Just do the following to build
only that module. Modules not using the UPM cmake macros may have different
naming.
~~~~~~~~~~~~~
make _pyupm_i2clcd
~~~~~~~~~~~~~
Sometimes you want to build a small C++ example against an installed library.
This is fairly easy if installed system-wide. Just link against the correct
library (in this case libupm-i2clcd) and then add /usr/include/upm to the
loader path:
~~~~~~~~~~~~
g++ test.cxx -lupm-i2clcd -I/usr/include/upm
~~~~~~~~~~~~
You can also use pkg-config to return the information to you, which is
considered the correct way if including UPM in a build system like cmake or
autotools on linux.
~~~~~~~~~~~
pkg-config --cflags --libs upm-i2clcd
~~~~~~~~~~~

View File

@ -2,15 +2,95 @@ Contributing a module {#contributions}
=====================
Here are the rules of contribution:
- Try not to break master. In any commit.
- Commits must have a sign-off line by everyone who reviewed them
- Commits must be named <file/module>: Some decent description
- You must license your module under an FOSS license. The recommended license
- Your new module must have an example that builds against your UPM library.
- Each commit must have a sign-off line by everyone who authored or reviewed
them.
- Commits must be named `<file/module>: Some decent description`.
- You must license your module under a FOSS license. The recommended license
is MIT but any permissive license is fine. Please consider that people using
UPM may want to write proprietary programs with your sensors so we like to
avoid GPL. (LGPL is fine). If your license is not MIT please include a
LICENSE file in src/<mymodule>/
avoid GPL. If your license is not MIT please include a LICENSE file in
src/mymodule/.
- The top of each source file must contain a comment block containing the
license information.
- Please test your module builds before contributing and make sure it works on
the latest version of mraa. If you tested on a specific board/platform please
tell us what this was in your PR.
the latest version of libmraa. If you tested on a specific board/platform
please tell us what this was in your PR.
- Try not to break master. In any commit.
- Attempt to have some decent API documentation as described in the the @ref
documentation [guide](documentation.md).
Including the MIT license
=========================
Choosing the [MIT license](http://opensource.org/licenses/MIT) is preferred for
the UPM repository. Below is the comment block needed at the top each source
file:
/*
* The MIT License (MIT)
*
* Author: <your full name>
* Copyright (c) <year> <copyright holder>
*
* Author: <contributing author full name - if applicable>
* Copyright (c) <year> <copyright holder>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
Code signing
============
The sign-off is a simple line at the end of the explanation for the
patch, which certifies that you wrote it or otherwise have the right to pass it
on as an open-source patch. The rules are pretty simple: if you can certify
the below:
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
then you just add a line to each of your commits with `--signoff` saying
Signed-off-by: Random J Developer <random@developer.example.org>
using your real name (sorry, no pseudonyms or anonymous contributions.)
Unsigned commits will not be accepted.

114
docs/documentation.md Normal file
View File

@ -0,0 +1,114 @@
Writing sensor documentation {#documentation}
=====================
It is highly encouraged to provide at least some basic documentation for the
sensors that you want to add to UPM:
- If you don't add documentation, the code review will take very long and
your contribution could be rejected.
- Try to have no warnings in doxygen, this is generally fairly easy.
- Have the specific sensor manufacturer/model & version that you used, if you
support multiple versions please list.
- Simple comments do not need full stops.
- Stick to <80 chars per line even in comments.
- No text is allowed on the same line as the start or end of a comment /** */.
####The sensor block
This is added just before the class declaration in your header(.h) file and has
mandatory fields. For single sensor libraries, this block will actually
follow immediately after the library block. If you have multiple physical
sensors, add this to every one.
Here's an example (disregard the "@verbatim" tags in your actual code):
```
@verbatim
/**
* @library <lib-name>
* @sensor <chip-id>
* @comname <component-name>
* @altname <alt-name>
* @type <component-category>
* @man <component-manufacturer>
* @web <component-weblinks>
* @con <connection-type>
* @kit <component-kit>
*
* @brief Short class/sensor description
*
* Then add a longer
* description here.
*
* @image html <component-img.jpeg>
* @snippet <example-name.cxx> Interesting
*/
@endverbatim
```
- `<lib-name>` When adding to an existing library this needs to match that
library's "@defgroup", otherwise this is a new library name, generally the
same as chip id. *Mandatory*
- `<chip-id>` Usually the chip number used by the sensor. When this is not
available or relevant, use a unique descriptor that makes sense. *Mandatory*
- `<component-name>` A short name for your sensor, can include manufacturer
name. *Mandatory*
- `<alt-name>` Alternative names or chip-ids that your sensor driver might
have or support respectively. *Optional*
- `<component-category>` Mention one or more categories the sensor fits in. Can
be 'other'. *Mandatory*
- `<component-manufacturer>` Sensor manufacturer. Can be 'generic'. *Mandatory*
- `<component-weblinks>` Links to vendors or data-sheets. *Optional*
- `<connection-type>` Specifies how does the sensor connect to the board
*Mandatory*
- `<component-kit>` Specifies if the sensor is part of a kit. *Optional*
Existing groups that can be used for the manufacturer, connection, category and
kit tags are found in the src/upm.h file.
Optionally, a small representative image can be placed in the "docs/images"
subfolder and linked with the "@image" tag.
**Please do not use existing, copyrighted images with your sensors!**
The example should have an 'Interesting' section which will be highlighted as
a code sample in doxygen. Everything in between such tags will show up in the
class documentation when "@snippet" is added at the end of a class docstring.
Tags use this format (in "example-name.cxx"):
```
@verbatim
//! [Interesting]
...example code here...
//! [Interesting]
@endverbatim
```
For more examples take a look at the existing headers in our github repository.
####The library block
New libraries must have the "@brief", "@defgroup" and "@ingroup" tags in one
block. This usually follows the namespace and it is common to have one sensor
per library.
You should end up with something like this:
```
@verbatim
/**
* @brief Short description for entire library
*
* Optional longer description.
*
* @defgroup <lib-name> libupm-<lib-name>
* @ingroup <manufacturer> <connection> <category> (<kit>)
*/
@endverbatim
```
In "@defgroup" use the same `<lib-name>` used in the sensor block. Multiple
sensors can be added to the same library this way.
For "@ingroup" add the same values as in the sensor block for manufacturer,
category, connection type and kit. If you have multiple classes or sensors
per library, only use the "@ingroup" tags that are common for all of them.

BIN
docs/images/adxl345.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
docs/images/am2315.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
docs/images/bmp085.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
docs/images/es0a.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

BIN
docs/images/grovergblcd.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
docs/images/groveslide.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
docs/images/hmc5883l.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
docs/images/htu21d.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

BIN
docs/images/hx711.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
docs/images/itg3200.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
docs/images/lsm303.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
docs/images/mic.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
docs/images/mpl3115a2.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

BIN
docs/images/mpr121.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

BIN
docs/images/mpu9150.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

BIN
docs/images/mq2-5.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
docs/images/mq3-9.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
docs/images/mq303a.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

BIN
docs/images/my9221.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

BIN
docs/images/nrf24l01.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

BIN
docs/images/nrf8001.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

BIN
docs/images/pca9685.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 KiB

BIN
docs/images/ppd42ns.JPG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

BIN
docs/images/pulsensor.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

BIN
docs/images/rfr359f.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

BIN
docs/images/rpr220.JPG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
docs/images/ssd1308.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
docs/images/ssd1327.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
docs/images/tm1637.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
docs/images/tp401.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -2,7 +2,7 @@ Making a UPM module for MAX31855 {#max31855}
================================
The Maxim Integrated MAX31855 is a thermocouple amplifier allowing you to read
from a K type themocouple. My board comes from the Pmod kit form Maxim
from a K type thermocouple. My board comes from the Pmod kit form Maxim
(MAX31855PMB1) but you can get this from many different sources. The adafruit
people made arduino code already so we'll use that as a
[reference](https://github.com/adafruit/Adafruit-MAX31855-library/blob/master/Adafruit_MAX31855.cpp).
@ -31,7 +31,8 @@ change between the javascript & node.js one is the argument to %module.
The %include parameter defines which functions will be available to the
node/python module created, Whilst the headers inside %{} will be explicitly
required during compilation. Typically only the top level header is required in
either of those args.
either of those args. The upm.i is just a shortcut to include some commonly
used swig wrappers for UPM sensors, it's not obligatory but recommended.
### API
@ -68,7 +69,7 @@ the implementation of MAX31855::getTemp()
Then using the arduino code as reference we simply reconstruct form the 4
uint8_t values a 32bit int value and select only the valuable parts of
information from that. The MAX31855 datahseet explains exactly which bits are
information from that. The MAX31855 datasheet explains exactly which bits are
useful, we will just do the same as the adafruit code, first checking the error
bit and then scrapping everything but the 14bit of thermocouple data that are
useful to us and converting it to a double.
@ -77,7 +78,7 @@ useful to us and converting it to a double.
### Finalizing
Our final example, very easy to use api!
Our final example, very easy to use API!
@snippet examples/max31855.cxx Interesting
@ -91,6 +92,6 @@ include_directories (${PROJECT_SOURCE_DIR}/src/max31855)
target_link_libraries (max31855-example max31855 ${CMAKE_THREAD_LIBS_INIT})
~~~~~~~~~~~
Note you dont have to rebuild everything, cmake keeps target lists so if you
named your example target <modulename>-example you can simply do make
Note you don't have to rebuild everything, cmake keeps target lists so if you
named your example target modulename-example you can simply do make
max31855-example and both the library & example will build.

View File

@ -1,24 +1,33 @@
Naming a module {#naming}
===============
UPM attemps to follow a clear naming pattern. Modules should be sensibly named
and then placed in /usr/lib/upm and headers in /usr/include/upm.
UPM attempts to follow a clear naming pattern. Modules should be sensibly named
and then placed in ${libdir}/upm and headers in ${includedir}/upm, all modules
should be prefixed with libupm-<modulename>. The upm_module_init will
automatically name python UPM modules as pyupm_<modulename> and javascript
modules as jsupm_<modulename>. For example for src/grove/ the library built
will be libupm-grove.so, the python module pyupm_grove and the js module
jsupm_grove.
### Choosing a name
### Choosing a name for a new module
1. Pick a name
2. Use it
1. Pick a name, typically the chip name is the most sensible
2. Use it & stick to it
### Rules for name picking
1. Your lib must belong to namespace UPM
2. Usually picking the name of the chip of your sensor/actuator might make
sense. Other times this does not. Try to pick a generic name so people with a
similar sensor can inherit your class if they only have minor changes.
3. Avoid brand names
1. Your lib must belong to the UPM namespace
2. Usually picking the name of the chip of your sensor/actuator makes sense.
Other times this does not. Try to pick a generic name so people with a similar
sensor can inherit your class if they only have minor changes.
3. Avoid brand names, often your module can be very generic with little effort
4. Use only lowercase characters in your file names and folder names.
### Doubt
If ever, give me a ping via email: brendan.le.foll@intel.com and I'll try
suggest decent names for your module.
If ever, give either of us a ping via email:
mihai.tudor.panu@intel.com
john.r.van.drasek@intel.com
brendan.le.foll@intel.com
and we'll try suggest decent names for your module.

View File

@ -3,19 +3,19 @@ Porting a module from Arduino {#porting}
Porting arduino libraries to libmraa as UPM libraries is usually fairly easy.
The issues typically come from misunderstanding of how a non real time OS deals
with interupts and timers. It also highly depends on the sensor. A concrete
with interrupts and timers. It also highly depends on the sensor. A concrete
example is explained in detail on @ref max31855
### Adding a new module to UPM
1. Choose a name for your module (see @ref naming)
2. Make a new folder in src/<modulename>
3. Create a CMakeLists.txt file inside src/<modulename>
2. Make a new folder in src/modulename
3. Create a CMakeLists.txt file inside src/modulename
### CmakeLists.txt
By default you need a header called <modulename>.h and a C++ file called
<modulename>.cxx. You can have multiple headers and source files. Only public
By default you need a header called modulename.h and a C++ file called
modulename.cxx. You can have multiple headers and source files. Only public
headers need to be added to module_h and all source files need to be in
module_src.
@ -36,9 +36,9 @@ required to talk to the board's IO. An I2c sensor will create a
mraa_i2c_context, keep it as a private member and require a bus number and slave
address in it's constructor.
Typically in sensors a simple object->read() function is prefered, depending on
your sensor/actuaotr this may or may not be easy or not even make sense. Most
UPM apis have a simple set of functions.
Typically in sensors a simple object->read() function is preferred, depending on
your sensor/actuator this may or may not be easy or not even make sense. Most
UPM APIs have a simple set of functions.
### Mapping arduino API to libmraa
@ -59,7 +59,7 @@ the UPM build system.
The last step is when you're happy with your module and it works send us a pull
request! We'd love to include your sensor in our repository.
If you don't like github you can also send brendan.le.foll@intel.com a git
formatted patch if your sensor. More details are on @ref contributing and on
If you don't like github you can also send mihai.tudor.panu@intel.com a git
formatted patch of your sensor. More details are on @ref contributions and on
https://help.github.com/articles/creating-a-pull-request

View File

@ -51,14 +51,14 @@ PROJECT_BRIEF = "Sensor/Actuator repository for libmraa (v@MRAA_VERSION
# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
# to the output directory.
PROJECT_LOGO =
PROJECT_LOGO =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY =
OUTPUT_DIRECTORY =
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
@ -99,7 +99,7 @@ BRIEF_MEMBER_DESC = YES
# brief descriptions will be completely suppressed.
# The default value is: YES.
REPEAT_BRIEF = YES
REPEAT_BRIEF = NO
# This tag implements a quasi-intelligent brief description abbreviator that is
# used to form the text in various listings. Each string in this list, if found
@ -129,6 +129,8 @@ ABBREVIATE_BRIEF = "The $name class" \
ALWAYS_DETAILED_SEC = NO
DETAILS_AT_TOP = YES
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
@ -154,7 +156,7 @@ FULL_PATH_NAMES = YES
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH =
STRIP_FROM_PATH =
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
@ -163,7 +165,7 @@ STRIP_FROM_PATH =
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.
STRIP_FROM_INC_PATH =
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
# less readable) file names. This can be useful is your file systems doesn't
@ -230,13 +232,21 @@ TAB_SIZE = 4
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines.
ALIASES =
ALIASES = library="@ingroup " \
sensor="@li **ID:** " \
comname="@li **Name:** " \
altname="@li **Other Names:** " \
type="@li **Category:** " \
man="@li **Manufacturer:** " \
web="@li **Link:** " \
con="@li **Connection:** " \
kit="@li **Kit:** " \
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
@ -280,7 +290,7 @@ OPTIMIZE_OUTPUT_VHDL = NO
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
EXTENSION_MAPPING =
EXTENSION_MAPPING =
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
@ -510,7 +520,7 @@ HIDE_SCOPE_NAMES = YES
# the files that are included by a file in the documentation of that file.
# The default value is: YES.
SHOW_INCLUDE_FILES = YES
SHOW_INCLUDE_FILES = NO
# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
# grouped member an include statement to the documentation, telling the reader
@ -536,7 +546,7 @@ INLINE_INFO = YES
# name. If set to NO the members will appear in declaration order.
# The default value is: YES.
SORT_MEMBER_DOCS = YES
SORT_MEMBER_DOCS = NO
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
# descriptions of file, namespace and class members alphabetically by member
@ -616,7 +626,7 @@ GENERATE_DEPRECATEDLIST= YES
# sections, marked by \if <section_label> ... \endif and \cond <section_label>
# ... \endcond blocks.
ENABLED_SECTIONS =
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
# initial value of a variable or macro / define can have for it to appear in the
@ -658,7 +668,7 @@ SHOW_NAMESPACES = YES
# by doxygen. Whatever the program writes to standard output is used as the file
# version. For an example see the documentation.
FILE_VERSION_FILTER =
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
@ -671,7 +681,7 @@ FILE_VERSION_FILTER =
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
LAYOUT_FILE =
LAYOUT_FILE = @CMAKE_CURRENT_SOURCE_DIR@/doxy/DoxygenLayout.xml
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
@ -682,7 +692,7 @@ LAYOUT_FILE =
# search path. Do not use file names with spaces, bibtex cannot handle them. See
# also \cite for info how to create references.
CITE_BIB_FILES =
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
@ -741,7 +751,7 @@ WARN_FORMAT = "$file:$line: $text"
# messages should be written. If left blank the output is written to standard
# error (stderr).
WARN_LOGFILE =
WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
@ -753,7 +763,8 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.
INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src \
INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src/upm.h \
@CMAKE_CURRENT_SOURCE_DIR@/src \
@CMAKE_CURRENT_SOURCE_DIR@/docs \
@CMAKE_CURRENT_SOURCE_DIR@/README.md
@ -847,7 +858,7 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS =
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@ -858,15 +869,15 @@ EXCLUDE_PATTERNS =
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS =
EXCLUDE_SYMBOLS = aci_*
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
# command).
EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/examples/ \
EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/examples/c++ \
@CMAKE_CURRENT_SOURCE_DIR@/docs/ \
@CMAKE_CURRENT_SOURCE_DIR@/src/max31855/
@CMAKE_CURRENT_SOURCE_DIR@/src/max31855/
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@ -886,7 +897,7 @@ EXAMPLE_RECURSIVE = NO
# that contain images that are to be included in the documentation (see the
# \image command).
IMAGE_PATH =
IMAGE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/docs/images/
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
@ -903,7 +914,7 @@ IMAGE_PATH =
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
INPUT_FILTER =
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
@ -912,7 +923,7 @@ INPUT_FILTER =
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS =
FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER ) will also be used to filter the input files that are used for
@ -927,7 +938,7 @@ FILTER_SOURCE_FILES = NO
# *.ext= (so without naming a filter).
# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
FILTER_SOURCE_PATTERNS =
FILTER_SOURCE_PATTERNS =
# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
# is part of the input, its contents will be placed on the main page
@ -1046,7 +1057,7 @@ COLS_IN_ALPHA_INDEX = 5
# while generating the index headers.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX =
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
@ -1090,7 +1101,7 @@ HTML_FILE_EXTENSION = .html
# of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_HEADER =
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
# generated HTML page. If the tag is left blank doxygen will generate a standard
@ -1100,7 +1111,7 @@ HTML_HEADER =
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FOOTER =
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
@ -1112,7 +1123,7 @@ HTML_FOOTER =
# obsolete.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET =
HTML_STYLESHEET =
# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
# defined cascading style sheet that is included after the standard style sheets
@ -1123,7 +1134,7 @@ HTML_STYLESHEET =
# see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET =
HTML_EXTRA_STYLESHEET =
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
@ -1133,7 +1144,7 @@ HTML_EXTRA_STYLESHEET =
# files will be copied as-is; there are no commands or markers available.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_FILES =
HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the stylesheet and background images according to
@ -1261,7 +1272,7 @@ GENERATE_HTMLHELP = NO
# written to the html output directory.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_FILE =
CHM_FILE =
# The HHC_LOCATION tag can be used to specify the location (absolute path
# including file name) of the HTML help compiler ( hhc.exe). If non-empty
@ -1269,7 +1280,7 @@ CHM_FILE =
# The file has to be specified with full path.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION =
HHC_LOCATION =
# The GENERATE_CHI flag controls if a separate .chi index file is generated (
# YES) or that it should be included in the master .chm file ( NO).
@ -1282,7 +1293,7 @@ GENERATE_CHI = NO
# and project file content.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
CHM_INDEX_ENCODING =
# The BINARY_TOC flag controls whether a binary table of contents is generated (
# YES) or a normal table of contents ( NO) in the .chm file.
@ -1312,7 +1323,7 @@ GENERATE_QHP = NO
# the HTML output folder.
# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE =
QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
@ -1337,7 +1348,7 @@ QHP_VIRTUAL_FOLDER = doc
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
@ -1345,21 +1356,21 @@ QHP_CUST_FILTER_NAME =
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
QHP_SECT_FILTER_ATTRS =
# The QHG_LOCATION tag can be used to specify the location of Qt's
# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
# generated .qhp file.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION =
QHG_LOCATION =
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
# generated, together with the HTML files, they form an Eclipse help plugin. To
@ -1492,7 +1503,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
MATHJAX_EXTENSIONS =
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
# of code that will be used on startup of the MathJax code. See the MathJax site
@ -1500,7 +1511,7 @@ MATHJAX_EXTENSIONS =
# example see the documentation.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_CODEFILE =
MATHJAX_CODEFILE =
# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
# the HTML output. The underlying search engine uses javascript and DHTML and
@ -1560,7 +1571,7 @@ EXTERNAL_SEARCH = NO
# Searching" for details.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHENGINE_URL =
SEARCHENGINE_URL =
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
# search data is written to a file for indexing by an external tool. With the
@ -1576,7 +1587,7 @@ SEARCHDATA_FILE = searchdata.xml
# projects and redirect the results back to the right project.
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH_ID =
EXTERNAL_SEARCH_ID =
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
# projects other than the one defined by this configuration file, but that are
@ -1586,7 +1597,7 @@ EXTERNAL_SEARCH_ID =
# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
# This tag requires that the tag SEARCHENGINE is set to YES.
EXTRA_SEARCH_MAPPINGS =
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
@ -1647,7 +1658,7 @@ PAPER_TYPE = a4
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
EXTRA_PACKAGES =
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
# generated LaTeX document. The header should contain everything until the first
@ -1663,7 +1674,7 @@ EXTRA_PACKAGES =
# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
LATEX_HEADER =
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
# generated LaTeX document. The footer should contain everything after the last
@ -1672,7 +1683,7 @@ LATEX_HEADER =
# Note: Only use a user-defined footer if you know what you are doing!
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_FOOTER =
LATEX_FOOTER =
# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the LATEX_OUTPUT output
@ -1680,7 +1691,7 @@ LATEX_FOOTER =
# markers available.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EXTRA_FILES =
LATEX_EXTRA_FILES =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
@ -1780,14 +1791,14 @@ RTF_HYPERLINKS = NO
# default style sheet that doxygen normally uses.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_STYLESHEET_FILE =
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an RTF document. Syntax is
# similar to doxygen's config file. A template extensions file can be generated
# using doxygen -e rtf extensionFile.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# Configuration options related to the man page output
@ -1848,13 +1859,13 @@ XML_OUTPUT = xml
# validating XML parser to check the syntax of the XML files.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_SCHEMA =
XML_SCHEMA =
# The XML_DTD tag can be used to specify a XML DTD, which can be used by a
# validating XML parser to check the syntax of the XML files.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_DTD =
XML_DTD =
# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
# listings (including syntax highlighting and cross-referencing information) to
@ -1931,7 +1942,7 @@ PERLMOD_PRETTY = YES
# overwrite each other's variables.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_MAKEVAR_PREFIX =
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
@ -1972,7 +1983,7 @@ SEARCH_INCLUDES = YES
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
@ -1980,7 +1991,7 @@ INCLUDE_PATH =
# used.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
INCLUDE_FILE_PATTERNS =
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that are
# defined before the preprocessor is started (similar to the -D option of e.g.
@ -1990,7 +2001,7 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED =
PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
@ -1999,7 +2010,7 @@ PREDEFINED =
# definition found in the source code.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_AS_DEFINED =
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
# remove all refrences to function-like macros that are alone on a line, have an
@ -2028,13 +2039,13 @@ SKIP_FUNCTION_MACROS = YES
# the path). If a tag file is not located in the directory in which doxygen is
# run, you must also specify the path to the tagfile here.
TAGFILES =
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
# tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE =
GENERATE_TAGFILE =
# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
# class index. If set to NO only the inherited external classes will be listed.
@ -2082,14 +2093,14 @@ CLASS_DIAGRAMS = NO
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
MSCGEN_PATH =
# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
# If left empty dia is assumed to be found in the default search path.
DIA_PATH =
DIA_PATH =
# If set to YES, the inheritance and collaboration graphs will hide inheritance
# and usage relations if the target is undocumented or is not a class.
@ -2138,7 +2149,7 @@ DOT_FONTSIZE = 10
# the path where dot can find it using this tag.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTPATH =
DOT_FONTPATH =
# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
# each documented class showing the direct and indirect inheritance relations.
@ -2209,7 +2220,7 @@ INCLUDE_GRAPH = YES
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = YES
INCLUDED_BY_GRAPH = NO
# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
# dependency graph for every global function or class method.
@ -2276,26 +2287,26 @@ INTERACTIVE_SVG = NO
# found. If left blank, it is assumed the dot tool can be found in the path.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_PATH =
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the \dotfile
# command).
# This tag requires that the tag HAVE_DOT is set to YES.
DOTFILE_DIRS =
DOTFILE_DIRS =
# The MSCFILE_DIRS tag can be used to specify one or more directories that
# contain msc files that are included in the documentation (see the \mscfile
# command).
MSCFILE_DIRS =
MSCFILE_DIRS =
# The DIAFILE_DIRS tag can be used to specify one or more directories that
# contain dia files that are included in the documentation (see the \diafile
# command).
DIAFILE_DIRS =
DIAFILE_DIRS =
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
# that will be shown in the graph. If the number of nodes in a graph becomes

198
doxy/DoxygenLayout.xml Normal file
View File

@ -0,0 +1,198 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.7 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="UPM Libraries" intro="Here is a
list of UPM libraries that can be used. Note that each of the classes
listed in these libraries are completely separate so you will need to link
against all those that you have used in your program. Use the hierarchical
tree to filter between different types of sensors."/> <tab
type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<detaileddescription title=""/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="no"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<detaileddescription title="API Description"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<functions title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<inlineclasses title=""/>
<functions title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<variables title=""/>
</memberdef>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title="Libraries"/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

View File

@ -1,66 +0,0 @@
add_executable (compass compass.cxx)
add_executable (groveled groveled.cxx)
add_executable (grovetemp grovetemp.cxx)
add_executable (lcm-lcd lcm-lcd.cxx)
add_executable (rgb-lcd rgb-lcd.cxx)
add_executable (buzzer-sound buzzer-sound.cxx)
add_executable (led-bar led-bar.cxx)
add_executable (seg-lcd 4digitdisplay.cxx)
add_executable (nrf_transmitter nrf_transmitter.cxx)
add_executable (nrf_receiver nrf_receiver.cxx)
add_executable (es08a es08a.cxx)
add_executable (son-hcsr04 hcsr04.cxx)
add_executable (oled-1308 oled-1308.cxx)
add_executable (oled-1327 oled-1327.cxx)
add_executable (proximity max44000.cxx)
add_executable (accelerometer mma7455.cxx)
add_executable (lcd st7735.cxx)
add_executable (max31855-example max31855.cxx)
add_executable (gy65-example gy65.cxx)
add_executable (stepmotor-example stepmotor.cxx)
add_executable (pulsensor-example pulsensor.cxx)
add_executable (mic-example mic-example.cxx)
add_executable (mpu9150-example mpu9150-example.cxx)
include_directories (${PROJECT_SOURCE_DIR}/src/hmc5883l)
include_directories (${PROJECT_SOURCE_DIR}/src/grove)
include_directories (${PROJECT_SOURCE_DIR}/src/lcd)
include_directories (${PROJECT_SOURCE_DIR}/src/buzzer)
include_directories (${PROJECT_SOURCE_DIR}/src/my9221)
include_directories (${PROJECT_SOURCE_DIR}/src/tm1637)
include_directories (${PROJECT_SOURCE_DIR}/src/nrf24l01)
include_directories (${PROJECT_SOURCE_DIR}/src/servo)
include_directories (${PROJECT_SOURCE_DIR}/src/hcsr04)
include_directories (${PROJECT_SOURCE_DIR}/src/max44000)
include_directories (${PROJECT_SOURCE_DIR}/src/mma7455)
include_directories (${PROJECT_SOURCE_DIR}/src/st7735)
include_directories (${PROJECT_SOURCE_DIR}/src/max31855)
include_directories (${PROJECT_SOURCE_DIR}/src/gy65)
include_directories (${PROJECT_SOURCE_DIR}/src/stepmotor)
include_directories (${PROJECT_SOURCE_DIR}/src/pulsensor)
include_directories (${PROJECT_SOURCE_DIR}/src/mic)
include_directories (${PROJECT_SOURCE_DIR}/src/mpu9150)
target_link_libraries (compass hmc5883l ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groveled grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovetemp grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (lcm-lcd i2clcd ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (rgb-lcd i2clcd ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (buzzer-sound buzzer ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (led-bar my9221 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (seg-lcd tm1637 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (nrf_transmitter nrf24l01 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (nrf_receiver nrf24l01 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (es08a servo ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (son-hcsr04 hcsr04 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (oled-1308 i2clcd ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (oled-1327 i2clcd ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (proximity max44000 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (accelerometer mma7455 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (lcd st7735 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (max31855-example max31855 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (gy65-example gy65 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (stepmotor-example stepmotor ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (pulsensor-example pulsensor ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mic-example mic ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mpu9150-example mpu9150 ${CMAKE_THREAD_LIBS_INIT})

323
examples/c++/CMakeLists.txt Normal file
View File

@ -0,0 +1,323 @@
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/examples)
add_executable (hmc5883l-example hmc5883l.cxx)
add_executable (groveled-example groveled.cxx)
add_executable (groveled-multi-example groveled-multi.cxx)
add_executable (groverelay-example groverelay.cxx)
add_executable (grovelight-example grovelight.cxx)
add_executable (grovetemp-example grovetemp.cxx)
add_executable (grovebutton-example grovebutton.cxx)
add_executable (groverotary-example groverotary.cxx)
add_executable (groveslide-example groveslide.cxx)
add_executable (lcm1602-lcd-example lcm1602-lcd.cxx)
add_executable (jhd1313m1-lcd-example jhd1313m1-lcd.cxx)
add_executable (buzzer-sound-example buzzer-sound.cxx)
add_executable (my9221-ledbar-example my9221-ledbar.cxx)
add_executable (my9221-updown-example my9221-updown.cxx)
add_executable (nrf24l01-transmitter-example nrf24l01-transmitter.cxx)
add_executable (nrf24l01-receiver-example nrf24l01-receiver.cxx)
add_executable (nrf24l01-broadcast-example nrf24l01-broadcast.cxx)
add_executable (es08a-example es08a.cxx)
add_executable (son-hcsr04-example hcsr04.cxx)
add_executable (ssd1308-oled-example ssd1308-oled.cxx)
add_executable (ssd1327-oled-example ssd1327-oled.cxx)
add_executable (max44000-example max44000.cxx)
add_executable (mma7455-example mma7455.cxx)
add_executable (st7735-example st7735.cxx)
add_executable (max31855-example max31855.cxx)
add_executable (bmpx8x-example bmpx8x.cxx)
add_executable (stepmotor-example stepmotor.cxx)
add_executable (pulsensor-example pulsensor.cxx)
add_executable (mic-example mic.cxx)
add_executable (mpu9150-example mpu9150.cxx)
add_executable (maxds3231m-example maxds3231m.cxx)
add_executable (max31723-example max31723.cxx)
add_executable (max5487-example max5487.cxx)
add_executable (nrf8001-broadcast-example nrf8001-broadcast.cxx)
add_executable (nrf8001-helloworld-example nrf8001-helloworld.cxx)
add_executable (lpd8806-example lpd8806.cxx)
add_executable (mlx90614-example mlx90614.cxx)
add_executable (ecs1030-example ecs1030.cxx)
add_executable (mq2-example mq2.cxx)
add_executable (mq3-example mq3.cxx)
add_executable (mq5-example mq5.cxx)
add_executable (mq9-example mq9.cxx)
add_executable (tp401-example tp401.cxx)
add_executable (tcs3414cs-example tcs3414cs.cxx)
add_executable (th02-example th02.cxx)
add_executable (ttp223-example ttp223.cxx)
add_executable (lsm303-example lsm303.cxx)
add_executable (joystick12-example joystick12-example.cxx)
add_executable (lol-example lol-example.cxx)
add_executable (tsl2561-example tsl2561.cxx)
add_executable (htu21d-example htu21d.cxx)
add_executable (mpl3115a2-example mpl3115a2.cxx)
add_executable (ldt0028-example ldt0028.cxx)
add_executable (am2315-example am2315.cxx)
add_executable (itg3200-example itg3200.cxx)
add_executable (enc03r-example enc03r.cxx)
add_executable (adc121c021-example adc121c021.cxx)
add_executable (ds1307-example ds1307.cxx)
add_executable (a110x-example a110x.cxx)
add_executable (gp2y0a-example gp2y0a.cxx)
add_executable (grovemoisture-example grovemoisture.cxx)
add_executable (groveehr-example groveehr.cxx)
add_executable (ta12200-example ta12200.cxx)
add_executable (grovelinefinder-example grovelinefinder.cxx)
add_executable (grovevdiv-example grovevdiv.cxx)
add_executable (grovewater-example grovewater.cxx)
add_executable (guvas12d-example guvas12d.cxx)
add_executable (groveloudness-example groveloudness.cxx)
add_executable (mpr121-example mpr121.cxx)
add_executable (ublox6-example ublox6.cxx)
add_executable (yg1006-example yg1006.cxx)
add_executable (wt5001-example wt5001.cxx)
add_executable (ppd42ns-example ppd42ns.cxx)
add_executable (mq303a-example mq303a.cxx)
add_executable (grovespeaker-example grovespeaker.cxx)
add_executable (rfr359f-example rfr359f.cxx)
add_executable (biss0001-example biss0001.cxx)
add_executable (rotaryencoder-example rotaryencoder.cxx)
add_executable (adxl345-example adxl345.cxx)
add_executable (rpr220-example rpr220.cxx)
add_executable (rpr220-intr-example rpr220-intr.cxx)
add_executable (mma7660-example mma7660.cxx)
add_executable (cjq4435-example cjq4435.cxx)
add_executable (adxl335-example adxl335.cxx)
add_executable (hmtrp-example hmtrp.cxx)
add_executable (nunchuck-example nunchuck.cxx)
add_executable (otp538u-example otp538u.cxx)
add_executable (grovecollision-example grovecollision.cxx)
add_executable (groveelectromagnet-example groveelectromagnet.cxx)
add_executable (groveemg-example groveemg.cxx)
add_executable (groveo2-example groveo2.cxx)
add_executable (grovegsr-example grovegsr.cxx)
add_executable (ina132-example ina132.cxx)
add_executable (l298-example l298.cxx)
add_executable (l298-stepper-example l298-stepper.cxx)
add_executable (at42qt1070-example at42qt1070.cxx)
add_executable (grovemd-example grovemd.cxx)
add_executable (pca9685-example pca9685.cxx)
add_executable (groveeldriver-example groveeldriver.cxx)
add_executable (adafruitss-example adafruitss.cxx)
add_executable (adafruitms1438-example adafruitms1438.cxx)
add_executable (adafruitms1438-stepper-example adafruitms1438-stepper.cxx)
add_executable (hx711-example hx711.cxx)
add_executable (flex-example flex.cxx)
add_executable (a110x-intr-example a110x-intr.cxx)
add_executable (mhz16-example mhz16.cxx)
add_executable (apds9002-example apds9002.cxx)
add_executable (waterlevel-example waterlevel.cxx)
add_executable (tm1637-example tm1637.cxx)
add_executable (zfm20-example zfm20.cxx)
add_executable (zfm20-register-example zfm20-register.cxx)
add_executable (uln200xa-example uln200xa.cxx)
add_executable (grovewfs-example grovewfs.cxx)
add_executable (isd1820-example isd1820.cxx)
include_directories (${PROJECT_SOURCE_DIR}/src/hmc5883l)
include_directories (${PROJECT_SOURCE_DIR}/src/grove)
include_directories (${PROJECT_SOURCE_DIR}/src/lcd)
include_directories (${PROJECT_SOURCE_DIR}/src/buzzer)
include_directories (${PROJECT_SOURCE_DIR}/src/my9221)
include_directories (${PROJECT_SOURCE_DIR}/src/nrf24l01)
include_directories (${PROJECT_SOURCE_DIR}/src/servo)
include_directories (${PROJECT_SOURCE_DIR}/src/hcsr04)
include_directories (${PROJECT_SOURCE_DIR}/src/max44000)
include_directories (${PROJECT_SOURCE_DIR}/src/mma7455)
include_directories (${PROJECT_SOURCE_DIR}/src/st7735)
include_directories (${PROJECT_SOURCE_DIR}/src/max31855)
include_directories (${PROJECT_SOURCE_DIR}/src/bmpx8x)
include_directories (${PROJECT_SOURCE_DIR}/src/stepmotor)
include_directories (${PROJECT_SOURCE_DIR}/src/pulsensor)
include_directories (${PROJECT_SOURCE_DIR}/src/mic)
include_directories (${PROJECT_SOURCE_DIR}/src/mpu9150)
include_directories (${PROJECT_SOURCE_DIR}/src/maxds3231m)
include_directories (${PROJECT_SOURCE_DIR}/src/max31723)
include_directories (${PROJECT_SOURCE_DIR}/src/max5487)
include_directories (${PROJECT_SOURCE_DIR}/src/nrf8001)
include_directories (${PROJECT_SOURCE_DIR}/src/lpd8806)
include_directories (${PROJECT_SOURCE_DIR}/src/mlx90614)
include_directories (${PROJECT_SOURCE_DIR}/src/ecs1030)
include_directories (${PROJECT_SOURCE_DIR}/src/gas)
include_directories (${PROJECT_SOURCE_DIR}/src/tcs3414cs)
include_directories (${PROJECT_SOURCE_DIR}/src/th02)
include_directories (${PROJECT_SOURCE_DIR}/src/ttp223)
include_directories (${PROJECT_SOURCE_DIR}/src/lsm303)
include_directories (${PROJECT_SOURCE_DIR}/src/joystick12)
include_directories (${PROJECT_SOURCE_DIR}/src/lol)
include_directories (${PROJECT_SOURCE_DIR}/src/tsl2561)
include_directories (${PROJECT_SOURCE_DIR}/src/htu21d)
include_directories (${PROJECT_SOURCE_DIR}/src/mpl3115a2)
include_directories (${PROJECT_SOURCE_DIR}/src/ldt0028)
include_directories (${PROJECT_SOURCE_DIR}/src/am2315)
include_directories (${PROJECT_SOURCE_DIR}/src/itg3200)
include_directories (${PROJECT_SOURCE_DIR}/src/enc03r)
include_directories (${PROJECT_SOURCE_DIR}/src/adc121c021)
include_directories (${PROJECT_SOURCE_DIR}/src/ds1307)
include_directories (${PROJECT_SOURCE_DIR}/src/a110x)
include_directories (${PROJECT_SOURCE_DIR}/src/gp2y0a)
include_directories (${PROJECT_SOURCE_DIR}/src/grovemoisture)
include_directories (${PROJECT_SOURCE_DIR}/src/groveehr)
include_directories (${PROJECT_SOURCE_DIR}/src/ta12200)
include_directories (${PROJECT_SOURCE_DIR}/src/grovelinefinder)
include_directories (${PROJECT_SOURCE_DIR}/src/grovevdiv)
include_directories (${PROJECT_SOURCE_DIR}/src/grovewater)
include_directories (${PROJECT_SOURCE_DIR}/src/guvas12d)
include_directories (${PROJECT_SOURCE_DIR}/src/groveloudness)
include_directories (${PROJECT_SOURCE_DIR}/src/mpr121)
include_directories (${PROJECT_SOURCE_DIR}/src/ublox6)
include_directories (${PROJECT_SOURCE_DIR}/src/yg1006)
include_directories (${PROJECT_SOURCE_DIR}/src/wt5001)
include_directories (${PROJECT_SOURCE_DIR}/src/ppd42ns)
include_directories (${PROJECT_SOURCE_DIR}/src/mq303a)
include_directories (${PROJECT_SOURCE_DIR}/src/grovespeaker)
include_directories (${PROJECT_SOURCE_DIR}/src/rfr359f)
include_directories (${PROJECT_SOURCE_DIR}/src/biss0001)
include_directories (${PROJECT_SOURCE_DIR}/src/rotaryencoder)
include_directories (${PROJECT_SOURCE_DIR}/src/adxl345)
include_directories (${PROJECT_SOURCE_DIR}/src/rpr220)
include_directories (${PROJECT_SOURCE_DIR}/src/mma7660)
include_directories (${PROJECT_SOURCE_DIR}/src/cjq4435)
include_directories (${PROJECT_SOURCE_DIR}/src/adxl335)
include_directories (${PROJECT_SOURCE_DIR}/src/hmtrp)
include_directories (${PROJECT_SOURCE_DIR}/src/nunchuck)
include_directories (${PROJECT_SOURCE_DIR}/src/otp538u)
include_directories (${PROJECT_SOURCE_DIR}/src/grovecollision)
include_directories (${PROJECT_SOURCE_DIR}/src/groveelectromagnet)
include_directories (${PROJECT_SOURCE_DIR}/src/groveemg)
include_directories (${PROJECT_SOURCE_DIR}/src/groveo2)
include_directories (${PROJECT_SOURCE_DIR}/src/grovegsr)
include_directories (${PROJECT_SOURCE_DIR}/src/ina132)
include_directories (${PROJECT_SOURCE_DIR}/src/l298)
include_directories (${PROJECT_SOURCE_DIR}/src/at42qt1070)
include_directories (${PROJECT_SOURCE_DIR}/src/grovemd)
include_directories (${PROJECT_SOURCE_DIR}/src/pca9685)
include_directories (${PROJECT_SOURCE_DIR}/src/groveeldriver)
include_directories (${PROJECT_SOURCE_DIR}/src/adafruitss)
include_directories (${PROJECT_SOURCE_DIR}/src/adafruitms1438)
include_directories (${PROJECT_SOURCE_DIR}/src/hx711)
include_directories (${PROJECT_SOURCE_DIR}/src/flex)
include_directories (${PROJECT_SOURCE_DIR}/src/mhz16)
include_directories (${PROJECT_SOURCE_DIR}/src/apds9002)
include_directories (${PROJECT_SOURCE_DIR}/src/waterlevel)
include_directories (${PROJECT_SOURCE_DIR}/src/tm1637)
include_directories (${PROJECT_SOURCE_DIR}/src/zfm20)
include_directories (${PROJECT_SOURCE_DIR}/src/uln200xa)
include_directories (${PROJECT_SOURCE_DIR}/src/grovewfs)
include_directories (${PROJECT_SOURCE_DIR}/src/isd1820)
target_link_libraries (hmc5883l-example hmc5883l ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groveled-example grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groveled-multi-example grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groverelay-example grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovelight-example grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovetemp-example grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovebutton-example grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groverotary-example grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groveslide-example grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (lcm1602-lcd-example i2clcd ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (jhd1313m1-lcd-example i2clcd ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (buzzer-sound-example buzzer ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (my9221-ledbar-example my9221 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (my9221-updown-example my9221 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (nrf24l01-transmitter-example nrf24l01 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (nrf24l01-receiver-example nrf24l01 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (nrf24l01-broadcast-example nrf24l01 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (es08a-example servo ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (son-hcsr04-example hcsr04 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (ssd1308-oled-example i2clcd ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (ssd1327-oled-example i2clcd ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (max44000-example max44000 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mma7455-example mma7455 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (st7735-example st7735 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (max31855-example max31855 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (bmpx8x-example bmpx8x ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (stepmotor-example stepmotor ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (pulsensor-example pulsensor ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mic-example mic ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mpu9150-example mpu9150 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (maxds3231m-example maxds3231m ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (max31723-example max31723 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (max5487-example max5487 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (nrf8001-broadcast-example nrf8001 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (nrf8001-helloworld-example nrf8001 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (lpd8806-example lpd8806 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mlx90614-example mlx90614 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (ecs1030-example ecs1030 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mq2-example gas ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mq3-example gas ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mq5-example gas ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mq9-example gas ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (tp401-example gas ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (tcs3414cs-example tcs3414cs ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (th02-example th02 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (ttp223-example ttp223 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (lsm303-example lsm303 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (joystick12-example joystick12 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (lol-example lol ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (tsl2561-example tsl2561 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (htu21d-example htu21d ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mpl3115a2-example mpl3115a2 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (ldt0028-example ldt0028 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (am2315-example am2315 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (itg3200-example itg3200 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (enc03r-example enc03r ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (adc121c021-example adc121c021 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (ds1307-example ds1307 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (a110x-example a110x ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (gp2y0a-example gp2y0a ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovemoisture-example grovemoisture ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groveehr-example groveehr ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (ta12200-example ta12200 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovelinefinder-example grovelinefinder ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovevdiv-example grovevdiv ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovewater-example grovewater ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (guvas12d-example guvas12d ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groveloudness-example groveloudness ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mpr121-example mpr121 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (ublox6-example ublox6 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (yg1006-example yg1006 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (wt5001-example wt5001 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (ppd42ns-example ppd42ns ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mq303a-example mq303a ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovespeaker-example grovespeaker ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (rfr359f-example rfr359f ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (biss0001-example biss0001 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (rotaryencoder-example rotaryencoder ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (adxl345-example adxl345 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (rpr220-example rpr220 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (rpr220-intr-example rpr220 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mma7660-example mma7660 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (cjq4435-example cjq4435 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (adxl335-example adxl335 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (hmtrp-example hmtrp ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (nunchuck-example nunchuck ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (otp538u-example otp538u ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovecollision-example grovecollision ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groveelectromagnet-example groveelectromagnet ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groveemg-example groveemg ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groveo2-example groveo2 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovegsr-example grovegsr ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (ina132-example ina132 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (l298-example l298 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (l298-stepper-example l298 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (at42qt1070-example at42qt1070 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovemd-example grovemd ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (pca9685-example pca9685 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groveeldriver-example groveeldriver ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (adafruitss-example adafruitss ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (adafruitms1438-example adafruitms1438 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (adafruitms1438-stepper-example adafruitms1438 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (hx711-example hx711 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (flex-example flex ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (a110x-intr-example a110x ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mhz16-example mhz16 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (apds9002-example apds9002 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (waterlevel-example waterlevel ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (tm1637-example tm1637 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (zfm20-example zfm20 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (zfm20-register-example zfm20 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (uln200xa-example uln200xa ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovewfs-example grovewfs ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (isd1820-example isd1820 ${CMAKE_THREAD_LIBS_INIT})

View File

@ -0,0 +1,76 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "a110x.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
// Our pulse counter
volatile unsigned int counter = 0;
// Our interrupt handler
void hallISR(void *arg)
{
counter++;
}
int main ()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate an A110X sensor on digital pin D2
upm::A110X* hall = new upm::A110X(2);
// This example uses a user-supplied interrupt handler to count
// pulses that occur when a magnetic field of the correct polarity
// is detected. This could be used to measure the rotations per
// minute (RPM) of a rotor for example.
hall->installISR(hallISR, NULL);
while (shouldRun)
{
cout << "Pulses detected: " << counter << endl;
sleep(1);
}
//! [Interesting]
cout << "Exiting..." << endl;
delete hall;
return 0;
}

67
examples/c++/a110x.cxx Normal file
View File

@ -0,0 +1,67 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "a110x.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main ()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate an A110X sensor on digital pin D2
upm::A110X* hall = new upm::A110X(2);
// check every second for the presence of a magnetic field (south
// polarity)
while (shouldRun)
{
bool val = hall->magnetDetected();
if (val)
cout << "Magnet (south polarity) detected." << endl;
else
cout << "No magnet detected." << endl;
sleep(1);
}
//! [Interesting]
cout << "Exiting..." << endl;
delete hall;
return 0;
}

View File

@ -0,0 +1,82 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <signal.h>
#include <iostream>
#include "adafruitms1438.h"
using namespace std;
using namespace upm;
int main(int argc, char **argv)
{
//! [Interesting]
// Instantiate an Adafruit MS 1438 on I2C bus 0
upm::AdafruitMS1438 *ms =
new upm::AdafruitMS1438(ADAFRUITMS1438_I2C_BUS,
ADAFRUITMS1438_DEFAULT_I2C_ADDR);
// Setup for use with a stepper motor connected to the M1 & M2 ports
// set a PWM period of 50Hz
// disable first, to be safe
ms->disableStepper(AdafruitMS1438::STEPMOTOR_M12);
// configure for a NEMA-17, 200 steps per revolution
ms->stepConfig(AdafruitMS1438::STEPMOTOR_M12, 200);
// set speed at 10 RPM's
ms->setStepperSpeed(AdafruitMS1438::STEPMOTOR_M12, 10);
ms->setStepperDirection(AdafruitMS1438::STEPMOTOR_M12,
AdafruitMS1438::DIR_CW);
// enable
cout << "Enabling..." << endl;
ms->enableStepper(AdafruitMS1438::STEPMOTOR_M12);
cout << "Rotating 1 full revolution at 10 RPM speed." << endl;
ms->stepperSteps(AdafruitMS1438::STEPMOTOR_M12, 200);
cout << "Sleeping for 2 seconds..." << endl;
sleep(2);
cout << "Rotating 1/2 revolution in opposite direction at 10 RPM speed."
<< endl;
ms->setStepperDirection(AdafruitMS1438::STEPMOTOR_M12,
AdafruitMS1438::DIR_CCW);
ms->stepperSteps(AdafruitMS1438::STEPMOTOR_M12, 100);
cout << "Disabling..." << endl;
ms->disableStepper(AdafruitMS1438::STEPMOTOR_M12);
cout << "Exiting" << endl;
//! [Interesting]
delete ms;
return 0;
}

View File

@ -0,0 +1,75 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <signal.h>
#include <iostream>
#include "adafruitms1438.h"
using namespace std;
using namespace upm;
int main(int argc, char **argv)
{
//! [Interesting]
// Instantiate an Adafruit MS 1438 on I2C bus 0
upm::AdafruitMS1438 *ms =
new upm::AdafruitMS1438(ADAFRUITMS1438_I2C_BUS,
ADAFRUITMS1438_DEFAULT_I2C_ADDR);
// Setup for use with a DC motor connected to the M3 port
// set a PWM period of 50Hz
ms->setPWMPeriod(50);
// disable first, to be safe
ms->disableMotor(AdafruitMS1438::MOTOR_M3);
// set speed at 50%
ms->setMotorSpeed(AdafruitMS1438::MOTOR_M3, 50);
ms->setMotorDirection(AdafruitMS1438::MOTOR_M3, AdafruitMS1438::DIR_CW);
cout << "Spin M3 at half speed for 3 seconds, then reverse for 3 seconds."
<< endl;
ms->enableMotor(AdafruitMS1438::MOTOR_M3);
sleep(3);
cout << "Reversing M3" << endl;
ms->setMotorDirection(AdafruitMS1438::MOTOR_M3, AdafruitMS1438::DIR_CCW);
sleep(3);
cout << "Stopping M3" << endl;
ms->disableMotor(AdafruitMS1438::MOTOR_M3);
cout << "Exiting" << endl;
//! [Interesting]
delete ms;
return 0;
}

View File

@ -0,0 +1,77 @@
/*
* Author: Stan Gifford <stan@gifford.id.au>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* Description
* Demo program for Adafruit 16 channel servo shield/controller
* Physical setup for tests is a single servo attached to one channel.
* Note - when 3 or more GWS servos attached results unpredictable.
* Adafruit do recommend a Cap be installed on the board which should alleviate the issue.
* I (and Adafruit) are unable to give any Capacitor sizing data.
*/
#include <iostream>
#include "adafruitss.h"
#include <unistd.h>
using namespace std;
int main() {
int n;
//! [Interesting]
upm::adafruitss* servos = new upm::adafruitss(6,0x40);
for (;;)
{
cout << "Setting all to 0" << endl;
for (n = 0; n < 16; n++)
servos->servo(n, 1, 0); // GWS Mini Servo = Type 1.
usleep(1000000); // Wait 1 second
cout << "Setting all to 45" << endl;
for (n = 0; n < 16; n++)
servos->servo(n, 1, 45);
usleep(1000000); // Wait 1 second
cout << "Setting all to 90" << endl;
for (n = 0; n < 16; n++)
servos->servo(n, 1, 90);
usleep(1000000); // Wait 1 second
cout << "Setting all to 135" << endl;
for (n = 0; n < 16; n++)
servos->servo(n, 1, 135);
usleep(1000000); // Wait 1 second
cout << "Setting all to 180" << endl;
for (n = 0; n < 16; n++)
servos->servo(n, 1, 160);
usleep(2000000); // Wait 1 second
}
//! [Interesting]
return 0;
}

View File

@ -0,0 +1,66 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <signal.h>
#include <iostream>
#include "adc121c021.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main(int argc, char **argv)
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate an ADC121C021 on I2C bus 0
upm::ADC121C021 *adc = new upm::ADC121C021(ADC121C021_I2C_BUS,
ADC121C021_DEFAULT_I2C_ADDR);
// An analog sensor, such as a Grove light sensor,
// must be attached to the adc
// Prints the value and corresponding voltage every 50 milliseconds
while (shouldRun)
{
uint16_t val = adc->value();
cout << "ADC value: " << val << " Volts = "
<< adc->valueToVolts(val) << endl;
usleep(50000);
}
//! [Interesting]
cout << "Exiting..." << endl;
delete adc;
return 0;
}

View File

@ -0,0 +1,66 @@
//////////////////////////////////////////////////////////////////////////////////////
// The MIT License (MIT)
//
// Submit Date: 03/09/2015
// Author: Juan Jose Chong <juanjchong@gmail.com>
// Copyright (c) 2015 Juan Jose Chong
//
//////////////////////////////////////////////////////////////////////////////////////
// adis16448.cxx
//////////////////////////////////////////////////////////////////////////////////////
//
// This example code runs on an Intel Edison and uses mraa to acquire data
// from an ADIS16448. This data is then scaled and printed onto the terminal.
//
// This software has been tested to connect to an ADIS16448 through a level shifter
// such as the TI TXB0104. The SPI lines (DIN, DOUT, SCLK, /CS) are all wired through
// the level shifter and the ADIS16448 is also being powered by the Intel Edison.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////////////////
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "adis16448.h"
int
main(int argc, char **argv)
{
while(true)
{
//! [Interesting]
upm::ADIS16448* imu = new upm::ADIS16448(0,3); //upm::ADIS16448(SPI,RST)
//Read the specified register, scale it, and display it on the screen
std::cout << "XGYRO_OUT:" << imu->gyroScale(imu->regRead(XGYRO_OUT)) << std::endl;
std::cout << "YGYRO_OUT:" << imu->gyroScale(imu->regRead(YGYRO_OUT)) << std::endl;
std::cout << "ZGYRO_OUT:" << imu->gyroScale(imu->regRead(ZGYRO_OUT)) << std::endl;
std::cout << " " << std::endl;
std::cout << "XACCL_OUT:" << imu->accelScale(imu->regRead(XACCL_OUT)) << std::endl;
std::cout << "YACCL_OUT:" << imu->accelScale(imu->regRead(YACCL_OUT)) << std::endl;
std::cout << "ZACCL_OUT:" << imu->accelScale(imu->regRead(ZACCL_OUT)) << std::endl;
std::cout << " " << std::endl;
//! [Interesting]
sleep(1);
}
return (0);
}

78
examples/c++/adxl335.cxx Normal file
View File

@ -0,0 +1,78 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "adxl335.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main ()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate an ADXL335 accelerometer on analog pins A0, A1, and A2
upm::ADXL335* accel = new upm::ADXL335(0, 1, 2);
cout << "Please make sure the sensor is completely still. Sleeping for"
<< " 2 seconds." << endl;
sleep(2);
cout << "Calibrating..." << endl;
accel->calibrate();
while (shouldRun)
{
int x, y, z;
float aX, aY, aZ;
accel->values(&x, &y, &z);
cout << "Raw Values: X: " << x << " Y: " << y << " Z: " << z << endl;
accel->acceleration(&aX, &aY, &aZ);
cout << "Acceleration: X: " << aX << "g" << endl;
cout << "Acceleration: Y: " << aY << "g" << endl;
cout << "Acceleration: Z: " << aZ << "g" << endl;
cout << endl;
usleep(200000);
}
//! [Interesting]
cout << "Exiting" << endl;
delete accel;
return 0;
}

51
examples/c++/adxl345.cxx Normal file
View File

@ -0,0 +1,51 @@
/*
* Author: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include "adxl345.h"
int
main(int argc, char **argv)
{
//! [Interesting]
int16_t *raw;
float *acc;
// Note: Sensor only works at 3.3V on the Intel Edison with Arduino breakout
upm::Adxl345* accel = new upm::Adxl345(0);
while(true){
accel->update(); // Update the data
raw = accel->getRawValues(); // Read raw sensor data
acc = accel->getAcceleration(); // Read acceleration (g)
fprintf(stdout, "Current scale: 0x%2xg\n", accel->getScale());
fprintf(stdout, "Raw: %6d %6d %6d\n", raw[0], raw[1], raw[2]);
fprintf(stdout, "AccX: %5.2f g\n", acc[0]);
fprintf(stdout, "AccY: %5.2f g\n", acc[1]);
fprintf(stdout, "AccZ: %5.2f g\n", acc[2]);
sleep(1);
}
//! [Interesting]
return 0;
}

75
examples/c++/am2315.cxx Normal file
View File

@ -0,0 +1,75 @@
/*
* Author: William Penner <william.penner@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "am2315.h"
volatile int doWork = 0;
upm::AM2315 *sensor = NULL;
void
sig_handler(int signo)
{
if (signo == SIGINT) {
printf("\nCtrl-C received.\n");
doWork = 1;
}
}
int
main(int argc, char **argv)
{
// Register signal handler
signal(SIGINT, sig_handler);
//! [Interesting]
float humidity = 0.0;
float temperature = 0.0;
sensor = new upm::AM2315(0, AM2315_I2C_ADDRESS);
sensor->testSensor();
while (!doWork) {
humidity = sensor->getHumidity();
temperature = sensor->getTemperature();
std::cout << "humidity value = " <<
humidity <<
", temperature value = " <<
temperature << std::endl;
usleep (500000);
}
//! [Interesting]
std::cout << "exiting application" << std::endl;
delete sensor;
return 0;
}

62
examples/c++/apds9002.cxx Normal file
View File

@ -0,0 +1,62 @@
/*
* Author: Zion Orent <zorent@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "apds9002.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main ()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate a Grove Luminance sensor on analog pin A0
upm::APDS9002* luminance = new upm::APDS9002(0);
while (shouldRun)
{
int val = luminance->value();
cout << "Luminance value is " << val << endl;
sleep(1);
}
//! [Interesting]
cout << "Exiting" << endl;
delete luminance;
return 0;
}

View File

@ -0,0 +1,90 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <signal.h>
#include <iostream>
#include "at42qt1070.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
void printButtons(upm::AT42QT1070 *touch)
{
bool buttonPressed = false;
uint8_t buttons = touch->getButtons();
cout << "Buttons Pressed: ";
for (int i=0; i<7; i++)
{
if (buttons & (1 << i))
{
cout << i << " ";
buttonPressed = true;
}
}
if (!buttonPressed)
cout << "None";
cout << endl;
if (touch->isCalibrating())
cout << "Calibration is occurring." << endl;
if (touch->isOverflowed())
cout << "Overflow was detected." << endl;
}
int main(int argc, char **argv)
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate an AT42QT1070 on I2C bus 0
upm::AT42QT1070 *touch = new upm::AT42QT1070(AT42QT1070_I2C_BUS,
AT42QT1070_DEFAULT_I2C_ADDR);
while (shouldRun)
{
touch->updateState();
printButtons(touch);
usleep(100000);
}
//! [Interesting]
cout << "Exiting..." << endl;
delete touch;
return 0;
}

68
examples/c++/biss0001.cxx Normal file
View File

@ -0,0 +1,68 @@
/*
* Author: Zion Orent <zorent@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "biss0001.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main ()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate a Grove Motion sensor on GPIO pin D2
upm::BISS0001* motion = new upm::BISS0001(2);
while (shouldRun)
{
bool val = motion->value();
if (val)
cout << "Detecting moving object";
else
cout << "No moving objects detected";
cout << endl;
sleep(1);
}
//! [Interesting]
cout << "Exiting" << endl;
delete motion;
return 0;
}

View File

@ -24,11 +24,11 @@
#include <unistd.h>
#include <iostream>
#include "gy65.h"
#include "bmpx8x.h"
#include <signal.h>
int doWork = 0;
upm::GY65 *sensor = NULL;
upm::BMPX8X *sensor = NULL;
void
sig_handler(int signo)
@ -49,8 +49,11 @@ main(int argc, char **argv)
float altitude = 0;
uint32_t sealevel = 0;
sensor = new upm::GY65(0, ADDR);
// Instantiate a BMPX8X sensor on I2C
sensor = new upm::BMPX8X(0, ADDR);
// Print the pressure, altitude, sea level, and
// temperature values every 0.1 seconds
while (!doWork) {
presure = sensor->getPressure ();
temperature = sensor->getTemperature ();
@ -59,7 +62,7 @@ main(int argc, char **argv)
std::cout << "pressure value = " <<
presure <<
", atitude value = " <<
", altitude value = " <<
altitude <<
", sealevel value = " <<
sealevel <<

View File

@ -30,17 +30,17 @@
int
main(int argc, char **argv) {
//! [Interesting]
int chord[] = { DO, RE, MI, FA, SOL, LA, SI, DO, SI };
//! [Interesting]
// create Buzzer instance
upm::Buzzer* sound = new upm::Buzzer(5);
// print sensor name
std::cout << sound->name() << std::endl;
// play sound (DO, RE, ME, etc...)
// play sound (DO, RE, MI, etc...), pausing for 0.1 seconds between notes
for (int chord_ind = 0; chord_ind < 7; chord_ind++) {
// play one second for each chord
// play each note for one second
std::cout << sound->playSound(chord[chord_ind], 1000000) << std::endl;
usleep(100000);
}

77
examples/c++/cjq4435.cxx Normal file
View File

@ -0,0 +1,77 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "cjq4435.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main ()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate a CJQ4435 MOSFET on a PWM capable digital pin D3
upm::CJQ4435* mosfet = new upm::CJQ4435(3);
mosfet->setPeriodMS(10);
mosfet->enable(true);
while (shouldRun)
{
// start with a duty cycle of 0.0 (off) and increment to 1.0 (on)
for (float i=0.0; i <= 1.0; i+=0.1)
{
mosfet->setDutyCycle(i);
usleep(100000);
}
sleep(1);
// Now take it back down
// start with a duty cycle of 1.0 (on) and decrement to 0.0 (off)
for (float i=1.0; i >= 0.0; i-=0.1)
{
mosfet->setDutyCycle(i);
usleep(100000);
}
sleep(1);
}
//! [Interesting]
cout << "Exiting..." << endl;
delete mosfet;
return 0;
}

77
examples/c++/ds1307.cxx Normal file
View File

@ -0,0 +1,77 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include "ds1307.h"
using namespace std;
void printTime(upm::DS1307 *rtc)
{
cout << "The time is: " <<
rtc->month << "/" << rtc->dayOfMonth << "/" << rtc->year << " "
<< rtc->hours << ":" << rtc->minutes << ":" << rtc->seconds;
if (rtc->amPmMode)
cout << (rtc->pm) ? " PM " : " AM ";
cout << endl;
cout << "Clock is in " << ((rtc->amPmMode) ? "AM/PM mode" : "24hr mode")
<< endl;
}
int
main(int argc, char **argv)
{
//! [Interesting]
// Instantiate a DS1037 on I2C bus 0
upm::DS1307 *rtc = new upm::DS1307(0);
// always do this first
cout << "Loading the current time... " << endl;
if (!rtc->loadTime())
{
cerr << "rtc->loadTime() failed." << endl;
return 0;
}
printTime(rtc);
// set the year as an example
cout << "setting the year to 50" << endl;
rtc->year = 50;
rtc->setTime();
// reload the time and print it
rtc->loadTime();
printTime(rtc);
//! [Interesting]
delete rtc;
return 0;
}

61
examples/c++/ecs1030.cxx Normal file
View File

@ -0,0 +1,61 @@
/*
* Author: Yevgeniy Kiveisha <yevgeniy.kiveisha@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include <stdlib.h>
#include "ecs1030.h"
int is_running = 0;
upm::ECS1030 *sensor = NULL;
void
sig_handler(int signo)
{
printf("got signal\n");
if (signo == SIGINT) {
is_running = 1;
}
}
//! [Interesting]
int
main(int argc, char **argv)
{
sensor = new upm::ECS1030(0);
signal(SIGINT, sig_handler);
while (!is_running) {
std::cout << "I = " << sensor->getCurrency_A () << ", Power = " << sensor->getPower_A () << std::endl;
std::cout << "I = " << sensor->getCurrency_B () << ", Power = " << sensor->getPower_B () << std::endl;
}
std::cout << "exiting application" << std::endl;
delete sensor;
return 0;
}
//! [Interesting]

79
examples/c++/enc03r.cxx Normal file
View File

@ -0,0 +1,79 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "enc03r.h"
using namespace std;
bool shouldRun = true;
// analog voltage, usually 3.3 or 5.0
#define CALIBRATION_SAMPLES 1000
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate a ENC03R on analog pin A0
upm::ENC03R *gyro = new upm::ENC03R(0);
// The first thing we need to do is calibrate the sensor.
cout << "Please place the sensor in a stable location, and do not" << endl;
cout << "move it while calibration takes place." << endl;
cout << "This may take a couple of minutes." << endl;
gyro->calibrate(CALIBRATION_SAMPLES);
cout << "Calibration complete. Reference value: "
<< gyro->calibrationValue() << endl;
// Read the input and print both the raw value and the angular velocity,
// waiting 0.1 seconds between readings
while (shouldRun)
{
unsigned int val = gyro->value();
double av = gyro->angularVelocity(val);
cout << "Raw value: " << val << ", "
<< "angular velocity: " << av << " deg/s" << endl;
usleep(100000);
}
//! [Interesting]
cout << "Exiting" << endl;
delete gyro;
return 0;
}

View File

@ -33,13 +33,25 @@ main(int argc, char **argv)
{
//! [Interesting]
upm::ES08A *servo = new upm::ES08A(5);
servo->setAngle (180);
//! [Interesting]
servo->setAngle (90);
servo->setAngle (0);
servo->setAngle (90);
// Sets the shaft to 180, then to 90, then to 0,
// then back to 90, and finally back to 180,
// pausing for a second in between each angle
servo->setAngle (180);
std::cout << "Set angle to 180" << std::endl;
sleep(1);
servo->setAngle (90);
std::cout << "Set angle to 90" << std::endl;
sleep(1);
servo->setAngle (0);
std::cout << "Set angle to 0" << std::endl;
sleep(1);
servo->setAngle (90);
std::cout << "Set angle to 90" << std::endl;
sleep(1);
servo->setAngle (180);
std::cout << "Set angle to 180" << std::endl;
//! [Interesting]
std::cout << "exiting application" << std::endl;

66
examples/c++/flex.cxx Normal file
View File

@ -0,0 +1,66 @@
/*
* Author: Zion Orent <zorent@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "flex.h"
using namespace std;
bool shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// The was tested with a Spectra Symbol flex sensor.
// We attached a 22K resistor to a breadboard,
// with 1 end attached to GND and the other connected to
// both the flex sensor and A0.
// The flex sensor was connected on 1 pin to the 22K resistor and A0
// and on the other pin to 5V.
// Instantiate a Flex sensor on analog pin A0
upm::Flex *flex = new upm::Flex(0);
while (shouldRun)
{
cout << "Flex value: " << flex->value() << endl;
sleep(1);
}
//! [Interesting]
cout << "Exiting" << endl;
delete flex;
return 0;
}

73
examples/c++/gp2y0a.cxx Normal file
View File

@ -0,0 +1,73 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "gp2y0a.h"
using namespace std;
bool shouldRun = true;
// analog voltage, usually 3.3 or 5.0
#define GP2Y0A_AREF 5.0
#define SAMPLES_PER_QUERY 20
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Note, for the Grove 80cm version of this sensor, due to the way
// it is wired, you need to plug this into the A0 port, where it
// will use the available A1 pin for data.
// Instantiate a GP2Y0A on analog pin A1
upm::GP2Y0A *volts = new upm::GP2Y0A(1);
// The higher the voltage (closer to AREF) the closer the object is. NOTE:
// the measured voltage will probably not exceed 3.3 volts.
// Every second, print the averaged voltage value (averaged over 20 samples).
while (shouldRun)
{
cout << "AREF: " << GP2Y0A_AREF
<< ", Voltage value (higher means closer): "
<< volts->value(GP2Y0A_AREF, SAMPLES_PER_QUERY) << endl;
sleep(1);
}
//! [Interesting]
cout << "Exiting" << endl;
delete volts;
return 0;
}

View File

@ -0,0 +1,49 @@
/*
* Author: Sarah Knepper <sarah.knepper@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include "grove.h"
int
main(int argc, char **argv)
{
// This example uses GPIO 0
//! [Interesting]
// Create the button object using GPIO pin 0
upm::GroveButton* button = new upm::GroveButton(0);
// Read the input and print, waiting one second between readings
while( 1 ) {
std::cout << button->name() << " value is " << button->value() << std::endl;
sleep(1);
}
// Delete the button object
delete button;
//! [Interesting]
return 0;
}

View File

@ -0,0 +1,69 @@
/*
* Author: Zion Orent <zorent@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <iostream>
#include <unistd.h>
#include <signal.h>
#include "grovecollision.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main(int argc, char **argv)
{
signal(SIGINT, sig_handler);
//! [Interesting]
// The was tested with the Grove Collision Sensor
// Instantiate a Grove Collision on digital pin D2
upm::GroveCollision* collision = new upm::GroveCollision(2);
bool collisionState = false;
cout << "No collision" << endl;
while (shouldRun)
{
if (collision->isColliding() && !collisionState)
{
cout << "Collision!" << endl;
collisionState = true;
}
else if (collisionState)
{
cout << "No collision" << endl;
collisionState = false;
}
}
//! [Interesting]
cout << "Exiting" << endl;
delete collision;
return 0;
}

78
examples/c++/groveehr.cxx Normal file
View File

@ -0,0 +1,78 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "groveehr.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate a Grove Ear-clip Heart Rate sensor on digital pin D2
upm::GroveEHR* heart = new upm::GroveEHR(2);
// set the beat counter to 0, init the clock and start counting beats
heart->clearBeatCounter();
heart->initClock();
heart->startBeatCounter();
while (shouldRun)
{
// we grab these just for display purposes in this example
uint32_t millis = heart->getMillis();
uint32_t beats = heart->beatCounter();
// heartRate() requires that at least 5 seconds pass before
// returning anything other than 0
int hr = heart->heartRate();
// output milliseconds passed, beat count, and computed heart rate
cout << "Millis: " << millis << " Beats: " << beats;
cout << " Heart Rate: " << hr << endl;
sleep(1);
}
heart->stopBeatCounter();
//! [Interesting]
cout << "Exiting..." << endl;
delete heart;
return 0;
}

View File

@ -0,0 +1,66 @@
/*
* Author: Zion Orent <zorent@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <iostream>
#include <unistd.h>
#include <signal.h>
#include "groveeldriver.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main(int argc, char **argv)
{
signal(SIGINT, sig_handler);
//! [Interesting]
// The was tested with the Grove El Driver Module
// Instantiate a Grove El Driver on digital pin D2
upm::GroveElDriver* eldriver = new upm::GroveElDriver(2);
bool lightState = true;
while (shouldRun)
{
if (lightState)
eldriver->on();
else
eldriver->off();
lightState = !lightState;
sleep(1);
}
//! [Interesting]
eldriver->off();
cout << "Exiting" << endl;
delete eldriver;
return 0;
}

View File

@ -0,0 +1,79 @@
/*
* Author: Zion Orent <zorent@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <iostream>
#include <time.h>
#include <signal.h>
#include "groveelectromagnet.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
float get_time()
{
return ((float)(clock()))/CLOCKS_PER_SEC;
}
int main(int argc, char **argv)
{
signal(SIGINT, sig_handler);
//! [Interesting]
// The was tested with the Grove Electromagnetic Module
// Instantiate a Grove Electromagnet on digital pin D2
upm::GroveElectromagnet* magnet = new upm::GroveElectromagnet(2);
cout << "Starting up magnet...." << endl;
magnet->off();
bool magnetState = false;
float time_passed = get_time();
// Turn magnet on and off every 5 seconds
while (shouldRun)
{
if ((get_time() - time_passed) > 5.0)
{
magnetState = !magnetState;
if (magnetState)
magnet->on();
else
magnet->off();
cout << "Turning magnet " << ((magnetState) ? "on" : "off") << endl;
time_passed = get_time();
}
}
//! [Interesting]
magnet->off();
cout << "Exiting" << endl;
delete magnet;
return 0;
}

60
examples/c++/groveemg.cxx Normal file
View File

@ -0,0 +1,60 @@
/*
* Author: Zion Orent <zorent@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "groveemg.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main(int argc, char **argv)
{
signal(SIGINT, sig_handler);
//! [Interesting]
// The was tested with the GroveEMG Muscle Signal Reader Sensor Module
// Instantiate a GroveEMG on analog pin A0
upm::GroveEMG *emg = new upm::GroveEMG(0);
cout << "Calibrating...." << endl;
emg->calibrate();
while (shouldRun)
{
cout << emg->value() << endl;
usleep(100000);
}
//! [Interesting]
cout << "Exiting" << endl;
delete emg;
return 0;
}

63
examples/c++/grovegsr.cxx Normal file
View File

@ -0,0 +1,63 @@
/*
* Author: Zion Orent <zorent@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "grovegsr.h"
using namespace std;
bool shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// The was tested with the GroveGSR Galvanic Skin Response Sensor module.
// Instantiate a GroveGSR on analog pin A0
upm::GroveGSR *gsr = new upm::GroveGSR(0);
cout << "Calibrating...." << endl;
gsr->calibrate();
while (shouldRun)
{
cout << gsr->value() << endl;
usleep(500000);
}
//! [Interesting]
cout << "Exiting" << endl;
delete gsr;
return 0;
}

View File

@ -0,0 +1,68 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014-2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "grove.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate a grove LED on D2. Here we are controlling a Grove
// Multi-color flash LED. We just just need to turn it on - it will
// then cycle through various colors (red, green, blue, purple) on it's
// own until turned off.
upm::GroveLed* led = new upm::GroveLed(2);
// start the light show
led->on();
// just sleep until interrupted
while (shouldRun)
sleep(1);
//! [Interesting]
led->off();
cout << "Exiting..." << endl;
delete led;
return 0;
}

View File

@ -1,5 +1,6 @@
/*
* Author: Brendan Le Foll <brendan.le.foll@intel.com>
* Contributions: Sarah Knepper <sarah.knepper@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
@ -29,9 +30,16 @@
int
main(int argc, char **argv)
{
// Use i2c device 0 all the time
//! [Interesting]
// Create the Grove LED object using GPIO pin 2
upm::GroveLed* led = new upm::GroveLed(2);
// Print the name
std::cout << led->name() << std::endl;
// Turn the LED on and off 10 times, pausing one second
// between transitions
for (int i=0; i < 10; i++) {
led->on();
sleep(1);
@ -39,5 +47,9 @@ main(int argc, char **argv)
sleep(1);
}
// Delete the Grove LED object
delete led;
//! [Interesting]
return 0;
}

View File

@ -0,0 +1,49 @@
/*
* Author: Brendan Le Foll <brendan.le.foll@intel.com>
* Contributions: Sarah Knepper <sarah.knepper@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include "grove.h"
int
main(int argc, char **argv)
{
//! [Interesting]
// Create the light sensor object using AIO pin 0
upm::GroveLight* light = new upm::GroveLight(0);
// Read the input and print both the raw value and a rough lux value,
// waiting one second between readings
while( 1 ) {
std::cout << light->name() << " raw value is " << light->raw_value() <<
", which is roughly " << light->value() << " lux" << std::endl;
sleep(1);
}
// Delete the light sensor object
delete light;
//! [Interesting]
return 0;
}

View File

@ -0,0 +1,66 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "grovelinefinder.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main ()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate a Grove Line Finder sensor on digital pin D2
upm::GroveLineFinder* finder = new upm::GroveLineFinder(2);
// check every second for the presence of white detection
while (shouldRun)
{
bool val = finder->whiteDetected();
if (val)
cout << "White detected." << endl;
else
cout << "Black detected." << endl;
sleep(1);
}
//! [Interesting]
cout << "Exiting..." << endl;
delete finder;
return 0;
}

View File

@ -0,0 +1,63 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "groveloudness.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main ()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate a Grove Loudness sensor on analog pin A0
upm::GroveLoudness* loudness = new upm::GroveLoudness(0);
// Print the loudness value every 0.1 seconds
while (shouldRun)
{
int val = loudness->value();
cout << "Loudness value (higher is louder): " << val << endl;
usleep(100000);
}
//! [Interesting]
cout << "Exiting" << endl;
delete loudness;
return 0;
}

60
examples/c++/grovemd.cxx Normal file
View File

@ -0,0 +1,60 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <signal.h>
#include <iostream>
#include "grovemd.h"
using namespace std;
int main(int argc, char **argv)
{
//! [Interesting]
// Instantiate an I2C Grove Motor Driver on I2C bus 0
upm::GroveMD *motors = new upm::GroveMD(GROVEMD_I2C_BUS,
GROVEMD_DEFAULT_I2C_ADDR);
// set direction to CW and set speed to 50%
cout << "Spin M1 and M2 at half speed for 3 seconds" << endl;
motors->setMotorDirections(upm::GroveMD::DIR_CW, upm::GroveMD::DIR_CW);
motors->setMotorSpeeds(127, 127);
sleep(3);
// counter clockwise
cout << "Reversing M1 and M2 for 3 seconds" << endl;
motors->setMotorDirections(upm::GroveMD::DIR_CCW, upm::GroveMD::DIR_CCW);
sleep(3);
//! [Interesting]
cout << "Stopping motors" << endl;
motors->setMotorSpeeds(0, 0);
cout << "Exiting..." << endl;
delete motors;
return 0;
}

View File

@ -0,0 +1,75 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "grovemoisture.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main ()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate a Grove Moisture sensor on analog pin A0
upm::GroveMoisture* moisture = new upm::GroveMoisture(0);
// Values (approximate):
// 0-300, sensor in air or dry soil
// 300-600, sensor in humid soil
// 600+, sensor in wet soil or submerged in water.
// Read the value every second and print the corresponding moisture level
while (shouldRun)
{
int val = moisture->value();
cout << "Moisture value: " << val << ", ";
if (val >= 0 && val < 300)
cout << "dry";
else if (val >= 300 && val < 600)
cout << "moist";
else
cout << "wet";
cout << endl;
sleep(1);
}
//! [Interesting]
cout << "Exiting" << endl;
delete moisture;
return 0;
}

57
examples/c++/groveo2.cxx Normal file
View File

@ -0,0 +1,57 @@
/*
* Author: Zion Orent <zorent@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "groveo2.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main(int argc, char **argv)
{
signal(SIGINT, sig_handler);
//! [Interesting]
// The was tested with the O2 Oxygen Concentration Sensor Module
// Instantiate a GroveO2 on analog pin A0
upm::GroveO2 *O2 = new upm::GroveO2(0);
while (shouldRun)
{
cout << "The output voltage is: " << O2->voltageValue() << "mV" << endl;
usleep(100000);
}
//! [Interesting]
cout << "Exiting" << endl;
delete O2;
return 0;
}

View File

@ -0,0 +1,58 @@
/*
* Author: Sarah Knepper <sarah.knepper@intel.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include "grove.h"
int
main(int argc, char **argv)
{
// This example uses GPIO 0
//! [Interesting]
// Create the relay switch object using GPIO pin 0
upm::GroveRelay* relay = new upm::GroveRelay(0);
// Close and then open the relay switch 3 times,
// waiting one second each time. The LED on the relay switch
// will light up when the switch is on (closed).
// The switch will also make a noise between transitions.
for ( int i = 0; i < 3; i++ ) {
relay->on();
if ( relay->isOn() )
std::cout << relay->name() << " is on" << std::endl;
sleep(1);
relay->off();
if ( relay->isOff() )
std::cout << relay->name() << " is off" << std::endl;
sleep(1);
}
// Delete the relay switch object
delete relay;
//! [Interesting]
return 0;
}

View File

@ -0,0 +1,57 @@
/*
* Author: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <iomanip>
#include "grove.h"
using namespace std;
int main ()
{
//! [Interesting]
// Instantiate a rotary sensor on analog pin A0
upm::GroveRotary* knob = new upm::GroveRotary(0);
// Print sensor name to confirm it initialized properly
cout << knob->name() << endl;
while(true) {
float abs_value = knob->abs_value(); // Absolute raw value
float abs_deg = knob->abs_deg(); // Absolute degrees
float abs_rad = knob->abs_rad(); // Absolute radians
float rel_value = knob->rel_value(); // Relative raw value
float rel_deg = knob->rel_deg(); // Relative degrees
float rel_rad = knob->rel_rad(); // Relative radians
fprintf(stdout, "Absolute: %4d raw %5.2f deg = %3.2f rad Relative: %4d raw %5.2f deg %3.2f rad\n",
(int16_t)abs_value, abs_deg, abs_rad, (int16_t)rel_value, rel_deg, rel_rad);
usleep(2500000); // Sleep for 2.5s
}
//! [Interesting]
delete knob;
return 0;
}

View File

@ -0,0 +1,50 @@
/*
* Author: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <iomanip>
#include "grove.h"
using namespace std;
int main ()
{
//! [Interesting]
upm::GroveSlide* slide = new upm::GroveSlide(0); // Instantiate new grove slide potentiometer on analog pin A0
cout << slide->name() << endl;
while(true) {
float adc_value = slide->raw_value(); // Read raw value
float volts = slide->voltage_value(); // Read voltage, board reference set at 5.0V
fprintf(stdout, "%4d = %.2f V\n", (uint16_t)adc_value, volts);
usleep(2500000); // Sleep for 2.5s
}
//! [Interesting]
delete slide;
return 0;
}

View File

@ -0,0 +1,49 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "grovespeaker.h"
using namespace std;
int main ()
{
//! [Interesting]
// Instantiate a Grove Speaker on digital pin D2
upm::GroveSpeaker* speaker = new upm::GroveSpeaker(2);
// Play all 7 of the lowest notes
speaker->playAll();
// Play a medium C-sharp
speaker->playSound('c', true, "med");
//! [Interesting]
cout << "Exiting" << endl;
delete speaker;
return 0;
}

View File

@ -0,0 +1,55 @@
/*
* Author: Brendan Le Foll <brendan.le.foll@intel.com>
* Contributions: Sarah Knepper <sarah.knepper@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <iomanip>
#include "grove.h"
int
main(int argc, char **argv)
{
//! [Interesting]
// Create the temperature sensor object using AIO pin 0
upm::GroveTemp* temp = new upm::GroveTemp(0);
std::cout << temp->name() << std::endl;
// Read the temperature ten times, printing both the Celsius and
// equivalent Fahrenheit temperature, waiting one second between readings
for (int i=0; i < 10; i++) {
int celsius = temp->value();
int fahrenheit = (int) (celsius * 9.0/5.0 + 32.0);
printf("%d degrees Celsius, or %d degrees Fahrenheit\n",
celsius, fahrenheit);
sleep(1);
}
// Delete the temperature sensor object
delete temp;
//! [Interesting]
return 0;
}

View File

@ -0,0 +1,67 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "grovevdiv.h"
using namespace std;
bool shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main ()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate a Grove Voltage Divider sensor on analog pin A0
upm::GroveVDiv* vDiv = new upm::GroveVDiv(0);
// collect data and output measured voltage according to the setting
// of the scaling switch (3 or 10)
while (shouldRun)
{
unsigned int val = vDiv->value(100);
float gain3val = vDiv->computedValue(3, val);
float gain10val = vDiv->computedValue(10, val);
cout << "ADC value: " << val << " Gain 3: " << gain3val
<< "v Gain 10: " << gain10val << "v" << endl;
sleep(1);
}
//! [Interesting]
cout << "Exiting..." << endl;
delete vDiv;
return 0;
}

View File

@ -0,0 +1,65 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "grovewater.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main ()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate a Grove Water sensor on digital pin D2
upm::GroveWater* water = new upm::GroveWater(2);
while (shouldRun)
{
bool val = water->isWet();
if (val)
cout << "Sensor is wet." << endl;
else
cout << "Sensor is dry." << endl;
sleep(1);
}
//! [Interesting]
cout << "Exiting..." << endl;
delete water;
return 0;
}

78
examples/c++/grovewfs.cxx Normal file
View File

@ -0,0 +1,78 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "grovewfs.h"
using namespace std;
int shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate a Grove Water Flow Sensor on digital pin D2
upm::GroveWFS* flow = new upm::GroveWFS(2);
// set the flow counter to 0 and start counting
flow->clearFlowCounter();
flow->startFlowCounter();
while (shouldRun)
{
// we grab these (,illis and flowCount) just for display
// purposes in this example
uint32_t millis = flow->getMillis();
uint32_t flowCount = flow->flowCounter();
float fr = flow->flowRate();
// output milliseconds passed, flow count, and computed flow rate
cout << "Millis: " << millis << " Flow Count: " << flowCount;
cout << " Flow Rate: " << fr << " LPM" << endl;
// best to gather data for at least one second for reasonable
// results.
sleep(2);
}
flow->stopFlowCounter();
//! [Interesting]
cout << "Exiting..." << endl;
delete flow;
return 0;
}

72
examples/c++/guvas12d.cxx Normal file
View File

@ -0,0 +1,72 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "guvas12d.h"
using namespace std;
bool shouldRun = true;
// analog voltage, usually 3.3 or 5.0
#define GUVAS12D_AREF 5.0
#define SAMPLES_PER_QUERY 1024
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// The was tested with the Grove UV Sensor module.
// It has a sensing range from between 200-400nm. It's strongest
// response is around 320-360nm.
// Instantiate a GUVAS12D on analog pin A0
upm::GUVAS12D *volts = new upm::GUVAS12D(0);
// The higher the voltage the more intense the UV radiation.
while (shouldRun)
{
cout << "AREF: " << GUVAS12D_AREF
<< ", Voltage value (higher means more UV): "
<< volts->value(GUVAS12D_AREF, SAMPLES_PER_QUERY) << endl;
sleep(1);
}
//! [Interesting]
cout << "Exiting" << endl;
delete volts;
return 0;
}

50
examples/c++/hmc5883l.cxx Normal file
View File

@ -0,0 +1,50 @@
/*
* Author: Brendan Le Foll <brendan.le.foll@intel.com>
* Contributions: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include "hmc5883l.h"
int
main(int argc, char **argv)
{
//! [Interesting]
// Instantiate on I2C
upm::Hmc5883l* compass = new upm::Hmc5883l(0);
int16_t *pos;
compass->set_declination(0.2749); // Set your declination from true north in radians
// Print out the coordinates, heading, and direction every second
while(true){
compass->update(); // Update the coordinates
pos = compass->coordinates();
fprintf(stdout, "coor: %5d %5d %5d ", pos[0], pos[1], pos[2]);
fprintf(stdout, "heading: %5.2f direction: %3.2f\n", compass->heading(), compass->direction());
sleep(1);
}
//! [Interesting]
return 0;
}

164
examples/c++/hmtrp.cxx Normal file
View File

@ -0,0 +1,164 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "hmtrp.h"
using namespace std;
bool shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
void printUsage()
{
cout << "Usage:" << endl;
cout << "Pass a commandline argument (any argument) to this program"
<< endl;
cout << "to query the radio configuration and output it. NOTE: the"
<< endl;
cout << "radio must be in CONFIG mode for this to work."
<< endl;
cout << endl;
cout << "Running this program without arguments will simply transmit"
<< endl;
cout << "'Hello World!' every second, and output any data received from"
<< endl;
cout << "another radio."
<< endl;
cout << endl;
}
const size_t bufferLength = 256;
int main (int argc, char **argv)
{
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate a HMTRP radio device on uart 0
upm::HMTRP* radio = new upm::HMTRP(0);
// make sure port is initialized properly. 9600 baud is the default.
if (!radio->setupTty(B9600))
{
cerr << "Failed to setup tty port parameters" << endl;
return 1;
}
printUsage();
// By default, this radio simply transmits data sent via writeData()
// and reads any available data via readData().
// It can be placed into a configuration mode by grounding the
// CONFIG pin on the module. When this is done, the various
// configuration query and config methods can be used. In this
// example, by default, we just read any data available fom the
// device, and periodically transmit "Hello World".
// If any argument was specified on the command line, do a simple
// configuration query and output the results. The radio must be in
// CONFIG mode for this to work.
if (argc > 1)
{
// config mode
uint32_t freq;
uint32_t dataRate;
uint16_t rxBandwidth;
uint8_t modulation;
uint8_t txPower;
uint32_t uartBaud;
if (radio->getConfig(&freq, &dataRate, &rxBandwidth, &modulation,
&txPower, &uartBaud))
{
cout << "Radio configuration:" << endl;
cout << "freq: " << freq << " dataRate: " << dataRate
<< " rxBandwidth: " << rxBandwidth << "Khz" << endl;
cout << "modulation: " << int(modulation) << "Khz txPower: "
<< int(txPower) << " uartBaud: " << uartBaud << endl;
}
else
{
cerr << "getConfig() failed. Make sure the radio is in "
<< "CONFIG mode." << endl;
}
}
else
{
// normal read/write mode
char radioBuffer[bufferLength];
int counter = 0;
cout << "Running in normal read/write mode." << endl;
while (shouldRun)
{
// we don't want the read to block in this example, so always
// check to see if data is available first.
if (radio->dataAvailable())
{
int rv = radio->readData(radioBuffer, bufferLength);
if (rv > 0)
cout << "Received: " << radioBuffer << endl;
if (rv < 0) // some sort of read error occured
{
cerr << "Port read error." << endl;
break;
}
continue;
}
usleep(100000); // 100ms
counter++;
// every second, transmit "Hello World"
if (counter > 10)
{
static const char *hello = "Hello World!";
cout << "Transmitting hello world..." << endl;
radio->writeData((char *)hello, strlen(hello) + 1);
counter = 0;
}
}
}
//! [Interesting]
cout << "Exiting..." << endl;
delete radio;
return 0;
}

79
examples/c++/htu21d.cxx Normal file
View File

@ -0,0 +1,79 @@
/*
* Author: William Penner <william.penner@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "htu21d.h"
volatile int doWork = 0;
upm::HTU21D *sensor = NULL;
void
sig_handler(int signo)
{
if (signo == SIGINT) {
printf("\nCtrl-C received.\n");
doWork = 1;
}
}
int
main(int argc, char **argv)
{
// Register signal handler
signal(SIGINT, sig_handler);
//! [Interesting]
float humidity = 0.0;
float temperature = 0.0;
float compRH = 0.0;
sensor = new upm::HTU21D(0, HTU21D_I2C_ADDRESS);
sensor->testSensor();
while (!doWork) {
compRH = sensor->getCompRH(true);
humidity = sensor->getHumidity(false);
temperature = sensor->getTemperature(false);
std::cout << "humidity value = " <<
humidity <<
", temperature value = " <<
temperature <<
", compensated RH value = " <<
compRH << std::endl;
usleep (500000);
}
//! [Interesting]
std::cout << "exiting application" << std::endl;
delete sensor;
return 0;
}

43
examples/c++/hx711.cxx Normal file
View File

@ -0,0 +1,43 @@
/*
*
* Author: Rafael da Mata Neri <rafael.neri@gmail.com>
* Copyright (c) 2015 Intel Corporation.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
//! [Interesting]
#include "hx711.h"
int
main(int argc, char **argv)
{
upm::HX711 *scale = new upm::HX711(3, 2);
// 2837: value obtained via calibration
scale->setScale(2837);
scale->tare();
std::cout << scale->getUnits() << std::endl;
return 0;
}
//! [Interesting]

61
examples/c++/ina132.cxx Normal file
View File

@ -0,0 +1,61 @@
/*
* Author: Zion Orent <zorent@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "ina132.h"
using namespace std;
bool shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main()
{
signal(SIGINT, sig_handler);
//! [Interesting]
// The was tested with the INA132 Differential Amplifier Sensor module.
// Instantiate an INA132 on analog pin A0
upm::INA132 *amplifier = new upm::INA132(0);
while (shouldRun)
{
cout << amplifier->value() << endl;
sleep(1);
}
//! [Interesting]
cout << "Exiting" << endl;
delete amplifier;
return 0;
}

80
examples/c++/isd1820.cxx Normal file
View File

@ -0,0 +1,80 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "isd1820.h"
using namespace std;
int main (int argc, char **argv)
{
//! [Interesting]
// Instantiate a ISD1820 on digital pins 2 (play) and 3 (record)
// This example was tested on the Grove Recorder.
upm::ISD1820* recorder = new upm::ISD1820(2, 3);
// if an argument was specified (any argument), go into record mode,
// else playback a previously recorded sample
cout << "Supply any argument to the command line to record." << endl;
cout << "Running this example without arguments will play back any " << endl;
cout << "previously recorded sound." << endl;
cout << "There is approximately 10 seconds of recording time." << endl;
cout << endl;
bool doRecord = false;
if (argc > 1)
doRecord = true;
// depending on what was selected, do it, and sleep for 15 seconds
if (doRecord)
recorder->record(true);
else
recorder->play(true);
// There are about 10 seconds of recording/playback time, so we will
// sleep for a little extra time.
cout << "Sleeping for 15 seconds..." << endl;
sleep(15);
// now, turn off whatever we were doing.
if (doRecord)
recorder->record(false);
else
recorder->play(false);
//! [Interesting]
cout << "Exiting..." << endl;
delete recorder;
return 0;
}

51
examples/c++/itg3200.cxx Normal file
View File

@ -0,0 +1,51 @@
/*
* Author: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include "itg3200.h"
int
main(int argc, char **argv)
{
//! [Interesting]
int16_t *rot;
float *ang;
// Note: Sensor not supported on Intel Edison with Arduino breakout
upm::Itg3200* gyro = new upm::Itg3200(0);
while(true){
gyro->update(); // Update the data
rot = gyro->getRawValues(); // Read raw sensor data
ang = gyro->getRotation(); // Read rotational speed (deg/sec)
fprintf(stdout, "Raw: %6d %6d %6d\n", rot[0], rot[1], rot[2]);
fprintf(stdout, "AngX: %5.2f\n", ang[0]);
fprintf(stdout, "AngY: %5.2f\n", ang[1]);
fprintf(stdout, "AngZ: %5.2f\n", ang[2]);
fprintf(stdout, "Temp: %5.2f Raw: %6d\n", gyro->getTemperature(), gyro->getRawTemp());
sleep(1);
}
//! [Interesting]
return 0;
}

Some files were not shown because too many files have changed in this diff Show More