Skip to content

Instantly share code, notes, and snippets.

@stianeikeland
Created September 24, 2012 16:13
Show Gist options
  • 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