Exemplo n.º 1
0
import os
import sys
from pprint import pprint

sys.path.insert(0,
                os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from smartphone_connector import Connector
from examples.server_address import SERVER_ADDRESS

device = Connector(SERVER_ADDRESS, 'FooBar')

device.set_grid([1, 2, 3, 4], base_color='blue')
device.sleep(1)

device.disconnect()
Exemplo n.º 2
0
sys.path.insert(0,
                os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from smartphone_connector import Connector
from examples.server_address import SERVER_ADDRESS

device = Connector(SERVER_ADDRESS, 'FooBar')

device.set_grid("""
    99999999999999
    99999....99999
    99999....99999
    99999....99999
    99999....99999
    9............9
    9............9
    9............9
    9............9
    99999....99999
    99999....99999
    99999....99999
    99999....99999
    99999999999999
    """,
                base_color='blue',
                enumerate=True)
device.sleep(1)
device.set_grid_at(20, 20, 'red')
device.sleep(1)
device.set_grid("""
90
09
""", enumerate=True)
Exemplo n.º 3
0
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from smartphone_connector import Connector
import numpy as np
from examples.server_address import SERVER_ADDRESS

device = Connector(SERVER_ADDRESS, 'FooBar')

grid1 = np.transpose([[1, 2, 3], [1, 2, 3], [1, 2, 3]])
device.set_grid(grid1,
                base_color='red'
                )
assert grid1.tolist() == device.get_grid
print('ok')

grid2 = np.transpose([[1, 2, 3], [1, 2, 3]])
device.set_grid(grid2,
                base_color='red'
                )
assert grid2.tolist() == device.get_grid
print('ok2')
device.disconnect()
Exemplo n.º 4
0
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from smartphone_connector import Connector
from examples.server_address import SERVER_ADDRESS

device = Connector(SERVER_ADDRESS, 'FooBar')
dimension = 1
device.set_grid([['white']])

while True:
    for i in range(dimension):

        device.set_grid_at(i, dimension, 'white' if dimension % 2 == 0 else 'black')
        device.set_grid_at(dimension, i, 'black' if dimension % 2 == 0 else 'white')
        device.sleep(0.05)
    dimension = dimension + 1

    if dimension > 50:
        device.set_grid([['white']])
        dimension = 1
        device.sleep(1)
Exemplo n.º 5
0
sys.path.insert(0,
                os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from smartphone_connector import Connector
from examples.server_address import SERVER_ADDRESS

device = Connector(SERVER_ADDRESS, 'FooBar')

device.set_grid("""
    99999999999999
    99999....99999
    99999....99999
    99999....99999
    99999....99999
    9............9
    9............9
    9............9
    9............9
    99999....99999
    99999....99999
    99999....99999
    99999....99999
    99999999999999
    """,
                base_color='red')
device.sleep(1)
pprint(device.get_grid)
device.set_grid_at(0, 0, 'red')
pprint(device.get_grid)
device.set_grid_at(0, 14, 'red')
pprint(device.get_grid)