46 Commits

Author SHA1 Message Date
Thomas Ingleby
170bdd104f spdx: add spdx tags to most files
Large change that removes the duplicated MIT notice withe a spdx tag

Signed-off-by: Thomas Ingleby <thomas.ingleby@intel.com>
2019-05-23 10:09:12 -07:00
Manivannan Sadhasivam
eda9d03547 examples: Cleanup Python examples
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-02-06 13:31:19 +01:00
Alex Tereschenko
6e13268301 examples: fix static code analysis findings
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2018-02-03 17:05:25 +01:00
Henry Bruce
a0332a13b0 examples: Python MCP3004 ADC example (use with MinnowMax Calamari lure)
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-11-21 10:23:21 +00:00
Houman Brinjcargorabi
b5b84c6186 examples: Added examples for initio by description
Signed-off-by: Houman Brinjcargorabi <houman.brinjcargorabi@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-06-27 11:46:24 +01:00
Fathi Boudra
e1c500414b docs: fix spelling errors
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-04-11 15:13:06 +01:00
deadprogram
de0b9e72c6 firmata: Add very simple mraa firmata examples for JS & Python
Signed-off-by: Ron Evans <ron@hybridgroup.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:12:30 +00:00
Henry Bruce
143bc38e47 examples: hello_isr.py now catches exception if invalid pin is specified
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
2016-03-22 18:04:57 +00:00
Henry Bruce
b1fd66c561 examples: Updated python gpio isr example
Example now takes pin number from command line and displays gpio level
when it changes.

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:04:57 +00:00
Alex Tereschenko
f9a31956ab examples: added more elaborated Python UART example
Closes #376.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-12-14 15:34:16 +00:00
Brendan Le Foll
797b137826 i2c_HM5883.py: remove old python example
Example was using old string based read API which is deprecated in python and
gives confusing advice, there are enough python i2c examples so removing this
one

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-25 16:01:36 +00:00
Brendan Le Foll
163a40e6e7 examples: add uart examples for js & py
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-20 15:04:03 +00:00
Alex Tereschenko
e7c3c17eb3 examples/aio: Added examples for mraa_aio_read_float()/readFloat()
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-05 10:43:26 +00:00
Brendan Le Foll
b7a0856f51 spi: Make Spi write() work from SWIG with typemaps
This change also changes the C++ API write(char) call to writeByte(uint8_t) and
the write() call now takes a uint8_t* instead of a char*. This should not alter
any code significantly and does not affect the C API.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-14 11:52:12 +00:00
Brendan Le Foll
23fca714e1 bmp85.py: add simple example of new i2c read func
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-06 11:24:55 +00:00
Brendan Le Foll
8be861aa1f hello_isr.py: add counter to example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-25 10:37:36 +00:00
Brendan Le Foll
ac02940174 rgblcd.py: update example to use only writeReg()
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-05 11:25:42 +00:00
Brendan Le Foll
54deb01796 exception: Add exceptions when context creation fails
* Exceptions only fired in constructor when it would initialise with a NULL
  context causing segfaults if used any further
* Adds exception.i requirement to mraa.i for node.js and python support

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-10-16 15:07:18 +01:00
Brendan Le Foll
dcc4efbaf8 hello_isr.py: add sleep to the example to reduce confusion
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-19 01:06:59 +01:00
Brendan Le Foll
9765aa9bce i2c_HMC5883.py: add python I2c.read() example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-08-05 10:44:43 +01:00
Brendan Le Foll
31c0eb33e5 i2c_HMC5883.py: add i2c read & write example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-07-29 16:02:42 +02:00
Brendan Le Foll
11f1f784c7 rgblcd.py: fix example to use 0xFF and not 0x255 which is out of bounds
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-07-29 12:16:27 +02:00
Brendan Le Foll
11a2e559a1 cycle-pwm3.py: make example use real pin3 and make work on gen2
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-07-24 15:17:11 +01:00
Brendan Le Foll
1f6afb0a18 cycle-pwm3.py: fix example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-07-24 10:10:04 +01:00
Brendan Le Foll
70ba5a56ab i2c: allow binary strings as parameters to write() functions in scripting
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-07-01 13:51:28 +01:00
Brendan Le Foll
c821c84e4a mraa: pymraa becomes mraa and mraajs becomes mraa
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-06-25 17:49:07 +01:00
Thomas Ingleby
6853997a92 mraa: rename from maa to mraa
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-06-24 17:24:54 +01:00
Brendan Le Foll
2664d7c0e0 hello_isr.py: add license header
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-06-24 14:41:41 +01:00
Brendan Le Foll
17edeb3e7a i2c.hpp: add I2c::writeReg method
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-06-24 14:40:34 +01:00
Kiveisha Yevgeniy
6fbe2a7e53 gpio: Added args param to maa_gpio_isr and added documentation
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
2014-06-19 16:23:43 +00:00
Brendan Le Foll
360c10a5e0 aio.py: add aio python example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-27 10:43:46 +01:00
Brendan Le Foll
521b6817d7 python: include examples page for sphinx documentation that links to src examples
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-20 15:39:58 +01:00
Brendan Le Foll
3731263752 C++: Change enum types to be shorter in C++
* This changes the swig interface so Python/Node APIs change slightly

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-19 09:49:30 +01:00
Brendan Le Foll
5d9fc39ae9 hello_isr.py: fix usage of isr in python example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-16 17:52:06 +01:00
Brendan Le Foll
f7169cc5c5 swig: Add support for isr/callbacks from python
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-13 20:47:50 +00:00
Brendan Le Foll
83a5e6cde8 maa.i: maa_init is now done after swig initialisation routine
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-07 17:39:58 +01:00
Brendan Le Foll
3e0d0c8241 python: fix examples and add maa_init() call in swig
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-02 14:08:49 +01:00
Thomas Ingleby
ea81a0ba75 examples: Update examples to use newer maa functions
* Use maa_init() before any other maa functions are called
* Use ioNN instead of gpioXX, Using mapping

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-05-01 17:08:54 +01:00
Brendan Le Foll
a0efbec625 hello_gpio.py: fix python example
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-04-25 09:10:27 +01:00
Brendan Le Foll
aee2087a42 maa: general licensing + styling cleanup
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-04-22 15:51:28 +01:00
Thomas Ingleby
36a15d5ed5 Merge branch 'pwm' into for-pull 2014-04-14 17:16:30 +01:00
Thomas Ingleby
2d074c2ca3 pwm: Added python example script
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-04-14 17:07:24 +01:00
Brendan Le Foll
2c07ad9260 readi2c: modify examples to use I2CSlave api 2014-04-11 17:06:24 +01:00
Thomas Ingleby
e64ffcf77d gpio: gpio in/out both work
* Python example included.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-04-11 15:55:01 +01:00
Brendan Le Foll
e59b8b2038 gpio: enable very basic gpio control from swig
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-04-10 18:00:57 +01:00
Brendan Le Foll
00ba95bac0 maa: Initial commit of maa, a python and nodejs I2C skeleton only 2014-04-08 18:45:30 +01:00