Ejemplo n.º 1
0
from __future__ import print_function
import sys
import time
#sys.path.append('..')
from pythymiodw import ThymioReal

m = ThymioReal()
while True:
    print('color top 1')
    m.leds_top(0, 0, 32)
    m.sleep(0.5)
    f = m.button_forward
    b = m.button_backward
    if b:
        break
    if f:
        print('forward')
m.quit()
Ejemplo n.º 2
0
from __future__ import print_function
import sys
#sys.path.append('..')

from pythymiodw import ThymioReal
import time

m = ThymioReal()
print(m.prox_horizontal)
print(m.prox_ground.delta)
print(m.prox_ground.reflected)
print(m.prox_ground.ambiant)
print(m.temperature)
print(m.accelerometer)
m.sleep(3)
print(m.prox_horizontal)
print(m.prox_ground.delta)
print(m.prox_ground.reflected)
print(m.prox_ground.ambiant)
print(m.temperature)
print(m.accelerometer)
m.quit()
Ejemplo n.º 3
0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Nov  7 16:38:29 2017

@author: root
"""

from pythymiodw import ThymioReal

robot=ThymioReal()
#robot.init_read()
robot.sleep(1)
print('move')
robot.wheels(100,100)
robot.sleep(5)
robot.wheels(0,100)
robot.sleep(4)
robot.wheels(100,100)
robot.sleep(5)
robot.wheels(100,0)
robot.sleep(4)
robot.wheels(100,100)
robot.sleep(5)
print('stop')
robot.wheels(0,0)
robot.quit()
Ejemplo n.º 4
0
from pythymiodw import ThymioReal

t = ThymioReal()
t.wheels(100, 100)
t.sleep(1)
t.quit()
Ejemplo n.º 5
0
import sys
#sys.path.append('..')
from pythymiodw import ThymioReal

m = ThymioReal()
while (1):
    m.wheels(100, 100)
    data = m.prox_horizontal
    #print(data)
    front = data[2]
    print(front)
    m.sleep(1)
    if front > 2000:
        m.quit()
        break
Ejemplo n.º 6
0
from __future__ import print_function
import sys

#sys.path.append('..')
from pythymiodw import ThymioReal

m = ThymioReal()
print('sound.system(7)')
m.sound_system(7)
m.sleep(2)
m.sound_system(-1)
m.sleep(2)
print('sound.freq(440,2)')
m.sound_freq(440, 2)
m.sleep(2)
m.sound_freq()
m.sleep(2)
m.quit()
Ejemplo n.º 7
0
import sys
import time
#sys.path.append('..')
from pythymiodw import ThymioReal

m = ThymioReal()
for i in range(4):
    m.wheels(100, 100)
    time.sleep(2)
    m.wheels(0, 0)
    time.sleep(1)

m.quit()
Ejemplo n.º 8
0
from __future__ import print_function
import sys
import time
#sys.path.append('..')
from pythymiodw import ThymioReal

m = ThymioReal()
print('color top 1')
m.leds_top(0, 0, 32)
m.sleep(2)
print('color top 2')
m.leds_top(32, 0, 0)
m.sleep(2)
print('circle led 0')
m.leds_circle(led0=32)
m.sleep(2)
print('circle led 3')
m.leds_circle(led3=32)
m.sleep(2)
print('button led 0')
m.leds_buttons(led0=32)
m.sleep(2)
print('button led 2')
m.leds_buttons(led2=32)
m.sleep(2)
print('prox h led 2')
m.leds_prox_h(led2=32)
m.sleep(2)
print('prox v led 2')
m.leds_prox_v(led2=32)
m.sleep(2)