Skip to content

Instantly share code, notes, and snippets.

@fraguada
Created September 3, 2016 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fraguada/71456b09cf585c57206a52814e93c2ce to your computer and use it in GitHub Desktop.
Save fraguada/71456b09cf585c57206a52814e93c2ce to your computer and use it in GitHub Desktop.
PyMetawear Neopixel Simple
from pymetawear import libmetawear
from pymetawear.client import MetaWearClient
c = MetaWearClient('XX:XX:XX:XX:XX:XX', 'pygatt', debug=True)
print("New client created: {0}".format(c))
#args board, strand, pin, #pixels, color order
libmetawear.mbl_mw_neopixel_init_slow_strand(c.board, 0, 0, 1, 0)
#args board, strand, pixel id, r, g, b
libmetawear.mbl_mw_neopixel_set_color(c.board, 0, 0, 100, 100, 100)
print('about to disconnect')
libmetawear.mbl_mw_neopixel_free_strand(c.board,0)
c.disconnect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment