GithubHelp home page GithubHelp logo

tableflip / nodebot-workshop Goto Github PK

View Code? Open in Web Editor NEW
207.0 22.0 59.0 7.59 MB

A nodeschool workshop on how to get your ardunio alive with johnny-five

Home Page: https://www.npmjs.org/package/nodebot-workshop

JavaScript 100.00%

nodebot-workshop's People

Contributors

achingbrain avatar alanshaw avatar ccarruitero avatar gitter-badger avatar gorhgorh avatar gyaresu avatar ldng avatar mainarthur avatar n0bisuke avatar olizilla avatar ruxandrafed avatar rwaldron avatar sole avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodebot-workshop's Issues

Exercise 4 - Fitzing diagram

I'm still learning so please forgive me if this is wrong.

But for me, this exercise works if the black cable coming from the button goes to 'Grnd', but in the diagram the black cable from the button goes to '5V'?

Blink exercise won't work with Littlebits

The Littlebits Arduino controller uses a different pin for LED output. An Arduino Uno uses pin 13, the Littlebits Leonardo board uses pin 5. The tests for the first workshop verify the pin settings of the program; which breaks in this case.

To reproduce: try and verify a working "blink" solution with Johnny-Five and a LIttleBits Arduino kit. Alertnatively, you can try changing the Led to something instead of 13, and you'll see the test breaking when it encounters the wrong pin number.

Testing methodology

I'm just attempting Exercise 8: Fire Alarm.

How do we test our code?

My code below doesn't work and I'm wondering if there might be room for an exercise in troubleshooting?

I can run instead of verify to get console.log() output but that doesn't seem to work within the testing script.

And I have no idea how to use io.digitalWrite.called from within exercise.js

Thanks!

var five = require('johnny-five')
var board = five.Board()

board.on('ready', function () {
  var temp = new five.Temperature({
    controller: 'TMP36',
    pin: 'A0'
  })
  var piezo = new five.Piezo(9)
  var led = new five.Led(13)
  var button = new five.Button(5)
  var buttonState = false
  led.stop().off()
  piezo.noTone()

  button.on('press', function () {
    buttonState = true
    led.stop().off()
    piezo.noTone()
  })

  temp.on('data', function () {

    if (buttonState === false && this.celsius > 50) {
      piezo.frequency(587, 500)
      led.strobe(1000)
    } else {
      led.stop().off()
      piezo.noTone()
    }
  })
})

Workshop name?

johnny-five-is-alive is too long to type on the command line. The current bin property in package.json calls it j5-tut...which is a bit boring.

What do you think about five-alive? It's available on npm (at the moment) as well.

If not, do you have any suggestions for catchy names?

Circuit diagrams

I just added a street lamp exercise. I think we should put ASCII circuit diagrams in the question text to make them look badass.

           PhotoR     10K
    +5 o---/\/\/--.--/\/\/--.--o GND
                  |         |
 Pin 0 o-----------         |
                            |
           LED     330      |
 Pin 9 o--->|-----/\/\/------

Unable to start any exercise.

Running on osx (have not upgraded to yosemite)

I have latest node v0.10.33 installed., I installed johnny five.
installed nodebot-workshop and the program runs correctly from command line.

Upon selecting any challenge, the following error occurs:

TypeError: Object 13.4.0 has no method 'contains'
at /usr/local/lib/node_modules/nodebot-workshop/node_modules/johnny-five/lib/board.js:28:18
at Object. (/usr/local/lib/node_modules/nodebot-workshop/node_modules/johnny-five/lib/board.js:30:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Object.require.extensions.(anonymous function) (/usr/local/lib/node_modules/nodebot-workshop/node_modules/proxyquire/lib/proxyquire.js:235:43)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Proxyquire._require (/usr/local/lib/node_modules/nodebot-workshop/node_modules/proxyquire/lib/proxyquire.js:156:19)
at require (module.js:380:17)
at Object. (/usr/local/lib/node_modules/nodebot-workshop/node_modules/johnny-five/lib/accelerometer.js:1:75)

Any ideas what might be going on?

Bill of Material?

Hello,

A Bill of Material would be really nice to have. I'm thinking about using this at a conference and having attendees build the circuits and run their apps on physical hardware after they pass each level. I need to figure out what would be required to create a kit for the people doing the exercise.

Once I'm done creating the list of parts, could I add it in the readme or somewhere else? I'll put together a PR for it.

Awesome work on this by the way. It's a really cool workshop. :)

Kyle

npm won't run the command.

every time i try to run the code nodebot-workshop
it states bash:nodebot-workshop command not found
I have had this problem with everything that i tried installing using NPM

adventure meeting needed !!!

let's meet !!!

i would realy love to talk about this project, it could really fuels the nodebots thing ( i really think that the whole chain needed make nodebot too much developper oriented)

just tell me when you think would be the good time to do that

Problems with the installation of nodebot-workshop

Hello:

I tried to install nodebot-workshop with the command:

npm install -g nodebot-workshop

but i get these instead:

C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error C2373: '__pfnDliNot
ifyHook2': redefinition; different type modifiers [C:\Users\nerve\AppData\Roaming\npm\node_modules\nodebot-workshop\nod
e_modules\weak\build\weakref.vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h(134): note: see declaration of '__pfnDliNot
  ifyHook2'
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\nerve\AppData\Roaming\npm\node_modules\nodebot-workshop\node_modules\weak
gyp ERR! node -v v6.4.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1

How can i solve this?

Thank you

Creates a couple of node process which end up slowing down my computer.

Hi,

I've been using this on my mac without connecting any Arduino. It started a couple of node process which has slowed down my mac.

At the moment I've got 4 node process, each one requesting an average of 88% of the CPU.
(went up to 15 process w/ an average of 20% cpu load).

Doesn't make actual sense to me but maybe you guys will manage to fix that.
( I guess it's related to the Arduino simulation when you verify/run the exercises. )

Thanks.

Spin Motor Spin verify does not work

The third level doesn't verify for us, even not with the correct solution from here.
We always get the following error:

Could not verify: motor not started again at 200: expected undefined to equal 200

We are trying this on a Mac with node v0.10.26.

street lamp

I create a sensor like so:

new Sensor({
  pin: "A0",
  freq: 250
})

this fails.

new five.Sensor('A0')

this passes

Piezo stub doesn't clear queued tones

The Johnny Five docs state that a Piezo's noTone or off methods clear queued tones, so that a previously run play method will be stopped and not restarted. However, this doesn't seem to be happening in the stub - an individual tone is indeed stopped, but a tune passed to play will continue playing with the next scheduled note.

Exercise Six; Ping Bell does not work for me

My arduino is wired up like is suggested in the png schematics.

When I run my code I get the following error:
"Could not verify: Piezo didn't play a tone when sent a UDP message: expected 0 to be above 0"

I also get this error when I run the code shown in the solution of this repository.

Code:

// EXERCISE SIX: PING BELL
// TODO: Create a UDP server that plays a sound when a message is received

// Attach a piezo to pin 8
// Use the "dgram" mode to create a "udp4" socket
// Bind your server to port "1337" and listen for messages
// When a message is received, have the piezo play a tune

// Require the johnny-five module
var five = require("johnny-five");

// Require "dgram" to work with datagram sockets for udp
var dgram = require("dgram");

// Instantiate a new board
var board = new five.Board();

board.on("ready", function() {
    // Creating a udp4 socket
    // TODO: What is dgram and a udp socket?
    var s = dgram.createSocket("udp4");

    // Attach the piezo to pin 8
    var piezo = new five.Piezo(8);

    // When server receives a message, play tune
    s.on("message", function() {
        piezo.tone(five.Piezo.Notes.c4, 1000);
        console.log("played");
    });
    // Bind to port "1337"
    s.bind(1337);
});

Challenge #8 - Fails using five.Temperature()

Solution shows using five.Sensor('A0') instead of five.Temperature({...

Is this a deprecation problem or am I just Doing It Wrongβ„’?

Thanks for advice in advance πŸ‘

var five = require('johnny-five')
var dnode = require('dnode')
var board = new five.Board()

board.on('ready', function () {

  var t = null

  var server = dnode({
    getTemperature: function (cb) {
      cb(t)
    }
  })

  server.listen(1337)

  var temp = new five.Temperature({
    controller: 'TMP36',
    pin: 'A0'
  })

  temp.on('data', function (err, data) {
    if (err) {
      console.error(err)
    }

    t = data.celsius
  })
})

Ping Bell: Piezo didn't play a tone when sent a UDP message β€” unsure of solution?

Hello hello,

Just got on board with nodebot-workshop, really enjoying it and finding everything a breeze to understand, it's very well done. However, on exercise 6, I get the following error:

Piezo didn't play a tone when sent a UDP message 

Now, I've compared my code to the solution, even trying a copy+paste at one point, yet it still fails. Is there something I'm missing here? Is something outdated?

Click to see code below.
var five = require('johnny-five');
var dgram = require('dgram');
var board = new five.Board();

board.on('ready', function() {

  var piezo = new five.Piezo(8);
  var server = dgram.createSocket('udp4');

  server.on('message', function() {
    piezo.tone(five.Piezo.Notes.c4, 1000);
  });

  server.bind(1337);

});

Answers on a postcard.

translations and update to newer version of workshopper

First nodeschool in paris is this weekend, I'll make a fast translation of the current ws content since i'm in a rush, but now the newer version of the workshopper have now l10n support i think we should update so we can decouple exercise and language and avoid package duplication.

what do you think about it ?

hardware solution tester

I really love that the workshop system can be run with no hardware attached, but, while seeing tests pass is alway nice, see things blink and move is a bit more rewarding, so i was thinking that we could make for all exercise a already built hardware setup, and a script that would require the student solution and inject it, so when someone's is passing the testing, he could just hook it to its usb and test it live.

If i have time i'll laser cut some boxes so the setup is sturdy and nice to look at

Exception on `run` and `verify`

Using nodebot-workshop version 2.2.5, and running the first exercise throws an exception:

MacBook-Pro-Dmitri:nodebot-workshop dmitri$ nodebot-workshop verify 01-blink-blink.js
module.js:338
    throw err;
          ^
Error: Cannot find module '/usr/local/lib/node_modules/nodebot-workshop/node_modules/johnny-five/node_modules/serialport/build/serialport/v1.7.4/Release/node-v14-darwin-x64/serialport.node'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Proxyquire._require (/usr/local/lib/node_modules/nodebot-workshop/node_modules/proxyquire/lib/proxyquire.js:158:19)
    at require (module.js:384:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/nodebot-workshop/node_modules/johnny-five/node_modules/serialport/serialport.js:14:25)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Object.require.extensions.(anonymous function) [as .js] (/usr/local/lib/node_modules/nodebot-workshop/node_modules/proxyquire/lib/proxyquire.js:237:43)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)

Any ideas?

01-blink-blink.js

var five = require('johnny-five');

var board = new five.Board();
board.on('ready', function () {
    var led = new five.Led(13);
    led.strobe(1000);
});

Node version is 0.12.4, OS X 10.10.3.

spin_motor_spin failing...

Seems as though 'spin_motor_spin' will always fail.
Even ran the solution in the source code and it also failed.

ERROR installing in windows

Hello, i trying to install in windows for node v6 and i get this error, how can i fix it?:

C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error C2373: '__pfnDliNotifyHook2': redefinition; different type mo
difiers [C:\Users\DiegoCamilo\AppData\Roaming\npm\node_modules\nodebot-workshop\node_modules\weak\build\weakref.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h(134): note: see declaration of '__pfnDliNotifyHook2'
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\DiegoCamilo\AppData\Roaming\npm\node_modules\nodebot-workshop\node_modules\weak
gyp ERR! node -v v6.7.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: node-gyp rebuild
npm WARN install:[email protected] Exit status 1

Typo in exercise 1

Close to the start of the problem description, it says 'Ardunio', instead of Arduino. Easy typo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.