python: fix examples and add maa_init() call in swig
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -25,13 +25,12 @@
|
|||||||
import pymaa as maa
|
import pymaa as maa
|
||||||
import time
|
import time
|
||||||
|
|
||||||
maa.maa_init()
|
maa.init()
|
||||||
x = maa.gpio_t()
|
x = maa.Gpio(8)
|
||||||
maa.gpio_init(x, 8)
|
x.dir(maa.MAA_GPIO_OUT)
|
||||||
maa.gpio_dir(x, "out")
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
maa.gpio_write(x,1)
|
x.write(1)
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
maa.gpio_write(x,0)
|
x.write(0)
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
import pymaa as maa
|
import pymaa as maa
|
||||||
import time
|
import time
|
||||||
|
|
||||||
maa.maa_init()
|
maa.init()
|
||||||
x = maa.PWM(0,3)
|
x = maa.PWM(0,3)
|
||||||
x.enable(1);
|
x.enable(1);
|
||||||
x.period_us(20)
|
x.period_us(20)
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
|
|
||||||
import pymaa
|
import pymaa
|
||||||
|
|
||||||
pumaa.maa_init()
|
pumaa.init()
|
||||||
x = pymaa.gpio_t()
|
x = pymaa.Gpio(13)
|
||||||
print(x.pin)
|
|
||||||
pymaa.gpio_init(x, 8)
|
|
||||||
print(x.pin)
|
print(x.pin)
|
||||||
|
|||||||
@@ -22,10 +22,10 @@
|
|||||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
import pymaa
|
import pymaa as maa
|
||||||
|
|
||||||
pumaa.maa_init()
|
maa.init()
|
||||||
x = pymaa.I2CSlave(27,28)
|
x = maa.I2c()
|
||||||
x.address(0x62)
|
x.address(0x62)
|
||||||
y= " "
|
y= " "
|
||||||
ret = x.read(y, 2)
|
ret = x.read(y, 2)
|
||||||
|
|||||||
@@ -74,5 +74,5 @@ if (SWIG_FOUND)
|
|||||||
include (${SWIG_USE_FILE})
|
include (${SWIG_USE_FILE})
|
||||||
|
|
||||||
add_subdirectory (python)
|
add_subdirectory (python)
|
||||||
add_subdirectory (javascript)
|
# add_subdirectory (javascript)
|
||||||
endif ()
|
endif ()
|
||||||
|
|||||||
Reference in New Issue
Block a user