Skip to content

Instantly share code, notes, and snippets.

@mko
Created August 21, 2012 23:47
Show Gist options
  • Save mko/3420549 to your computer and use it in GitHub Desktop.
Save mko/3420549 to your computer and use it in GitHub Desktop.
Example of Node-like callback behavior with Sphero SDK
bot.setRGB(req.param('red'), req.param('green'), req.param('blue'), function(err, data) {
if(err) {
reply.error = new Error(err.message);
} else {
reply = data;
}
});
res.send(reply);
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment