Last active
February 27, 2017 21:24
-
-
Save hpsaturn/8255228148b42e2cebde905fc1907ae6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zmq | |
import time | |
import driver_pb2 as driver_proto | |
creator_ip = '127.0.0.1' # or local ip of MATRIX creator | |
creator_gpio_base_port = 20013 + 36 | |
context = zmq.Context() | |
socket = context.socket(zmq.PUSH) | |
socket.connect('tcp://' + creator_ip + ':' + str(creator_gpio_base_port)) | |
config = driver_proto.DriverConfig() | |
config.gpio.pin = 15 | |
config.gpio.mode = driver_proto.GpioParams.OUTPUT | |
while True: | |
config.gpio.value ^= 1 | |
socket.send(config.SerializeToString()) | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MATRIX Creator - Python hello world
GPIO 15 pin toggle via MALOS layer