Skip to content

Instantly share code, notes, and snippets.

@hpsaturn
Last active February 27, 2017 21:24
Show Gist options
  • Save hpsaturn/8255228148b42e2cebde905fc1907ae6 to your computer and use it in GitHub Desktop.
Save hpsaturn/8255228148b42e2cebde905fc1907ae6 to your computer and use it in GitHub Desktop.
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)
@hpsaturn
Copy link
Author

MATRIX Creator - Python hello world

GPIO 15 pin toggle via MALOS layer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment