The API has been changed in some cases - see the apichanges.md
document.
In addition, this driver uses a new upm_vectortypes.i SWIG interface
file to provide a mechanism for methods that return a vector of floats
and ints instead of a pointer to an array.
This works much nicer than C array pointers, and results in Python/JS/Java
code that looks much more "natural" to the language in use.
The Python, JS, and Java examples have been changed to use these
methods. Support for the "old" C-style pointer methods are still
provided for backward compatibility with existing code.
As an example - to retrieve the x, y, and z data for Euler Angles from
the bno055, the original python code would look something like:
...
x = sensorObj.new_floatp()
y = sensorObj.new_floatp()
z = sensorObj.new_floatp()
...
sensor.getEulerAngles(x, y, z)
...
print("Euler: Heading:", sensorObj.floatp_value(x), end=' ')
print(" Roll:", sensorObj.floatp_value(y), end=' ')
...
Now the equivalent code is simply:
floatData = sensor.getEulerAngles()
print("Euler: Heading:", floatData[0], ...
print(" Roll:", floatData[1], end=' ')
...
Additionally, interrupt handling for Java is now implemented
completely in the C++ header file now rather than the .cxx file, so no
special SWIG processing is required anymore. See Issue #518 .
Signed-off-by: Jon Trulson <jtrulson@ics.com>
These changes add the ability to intialize a speaker instance to use a
PWM pin instead of a standard GPIO pin in order to emit sounds.
The current GPIO functionality is fairly constrained by the
implementation -- it only permits playing cerain hardcoded "notes".
The PWM support allows one to emit specific frequencies (currently
between 50-32Khz) using a PWM pin. Of course, you may still be
constrained by the limits of your PWM hardware in the end.
There are a few new functions provided to support this PWM mode. To
use the PWM mode of speaker, use the speaker_init_pwm() initialization
routine instead of speaker_init() (for C). For C++ and the SWIG
languages, pass "true" as the second argument to the constructor to
enable PWM mode. The default is "false", to match current default
behavior (GPIO).
Functions that are not related to a given mode (GPIO vs. PWM) will do
nothing if not usable in that mode.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
uartat is the underlying UART driver, specifically for use with
AT-style command driven devices like modems.
The le910 support is provided in the form of examples that make use
of the uartat driver to interact with the device.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Previously, the C++ and C versions of this driver were separate. Now
the C++ implementation wraps the C implementation.
In addition, the C++ init() function has been deprecated. It
currently does nothing, and examples have been modified to remove it's
calls. This function will be removed in a separate release.
The examples have been further modified to update all detected devices
and print their respective temperatures, instead of only reporting the
on the first device detected.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Make these just a bit more interesting - continuously change color
and keep updating the lcd. Also, echo the write via printf.
Signed-off-by: Noel Eck <noel.eck@intel.com>
This adds SPI support to the BMI160, as well as a C driver and a C
example. In addition, some changes were made to more properly detect
and handle errors.
Functions supplied by the bosch_bmi160 driver source code is also
exported and made available to callers who want more than what the
basic driver support. Bus access methods (I2C and SPI) are also now
exposed to both C and C++.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit cleans up multiple items with the UPM C example source.
* Switch from usleep and sleep to upm_delay* methods
* Include a mraa_init and check return value prior to using sensor
* All example mains now return
* Added include for mraa.h and upm_utilites.h to all examples
* Reformatted/removed tabs
* Updated author line for the examples I wrote
Signed-off-by: Noel Eck <noel.eck@intel.com>
This driver was developed with a DFRobot SHT10 Temperature and Humidity
sensor. This driver should work on all SHT1X devices.
It requires a 10K pull-up resistor connected to the data pin.
The sensor can be run at differing voltages from 2.5v to 5v.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This module implements support for the DFRobot EC (Electrical
Conductivity) meter. It relies on the use of the DS18B20 UPM C module
for temperature gathering.
It has a pretty complicated calibration procedure which is somewhat
documented on the DFRobot wiki. Functions have been added to support
changing the various coefficients as desired.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit adds a C implementation for the DS18B20. The C++
implementation was untouched (ie: it does not wrap the C
implementation). This can be done in the future if desired.
In addition, add an ascii-schematic to both the .h and .hpp files to
better illustrate how to wire up the DS 1-wire interface for the UART.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Previously, C examples were being linked with the C++ libs. This
worked, since currently (until ds18b20) all C++ libraries with C
components simply wrapped the C componenets.
Now we make sure that only the C libs are ever linked with the C
examples.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This module was initially known as GroveCollision. It has been
now changed to Collision. C source and examples added.
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
* Removed relay and rotary from grove library
* Removed relay and rotary from grove SWIG interfaces
* Fixed warning for o2 printf %
* Fixed return value warning for _get_normalized method used by
my analog sensors.
Signed-off-by: Noel Eck <noel.eck@intel.com>