Skip to content

Instantly share code, notes, and snippets.

@stianeikeland
Created September 24, 2012 16:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stianeikeland/3776770 to your computer and use it in GitHub Desktop.
Save stianeikeland/3776770 to your computer and use it in GitHub Desktop.
Subscribe to sensor data.
sub = (require 'zmq').socket 'sub'
sub.connect 'tcp://raspberrypi:9999'
sub.subscribe 'sensor'
sub.on 'message', (topic, data) -> console.log "#{topic} => #{data}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment