Skip to content

Instantly share code, notes, and snippets.

View motiooon's full-sized avatar

Gabriel Baciu motiooon

View GitHub Profile
function lbPick (a){
var str = '';
a.forEach(function(field){
str+='&filter[fields]['+field+']=1';
});
return str;
}
function lbGetPage(page){
var str = '&filter[limit]=50&filter[skip]=' + ((page-1) * 50);
var mongoose = require('mongoose'),
request = require('request'),
async = require('async'),
config = require('../config/config'),
_ = require('lodash');
var helpers = require('../loopback_helpers');
/**
* Do Search
var raspi = require('raspi-io');
var board = new raspi();
// Read a pin value
console.log(board.pins[board.normalize('P1-7')].value);
// Initialize the board
board.on('ready', function () {
var Motor1A = 'P1-16';
var raspi = require('raspi-io');
var board = new raspi();
// Initialize the board
board.on('ready', function () {
// var Motor1A = 'P1-16';
// var Motor1B = 'P1-18';
// var Motor1E = 'P1-22';
pi@raspberrypi ~/projects/robot $ sudo node start.js
1420336684394 Device(s) RaspberryPi-IO
1420336684555 Connected RaspberryPi-IO
1420336684561 Repl Initialized
>>
/home/pi/projects/robot/start.js:28
board.pinMode(Motor1A, board.MODES.OUTPUT);
^
TypeError: Cannot read property 'OUTPUT' of undefined
at Board.<anonymous> (/home/pi/projects/robot/start.js:28:37)
var raspi = require('raspi-io');
var five = require('johnny-five');
var board = new five.Board({
io: new raspi()
});
// Initialize the board
board.on('ready', function () {
// var Motor1A = 'P1-16';
var raspi = require('raspi-io');
var five = require('johnny-five');
var board = new five.Board({
io: new raspi()
});
// Initialize the board
board.on('ready', function () {
var Motor1A = 'P1-16';