jsconfcn/nodebots-session

Name: nodebots-session

Owner: jsconfcn

Description: The code for nodebots session for 2015 Shen JS

Created: 2015-05-07 09:51:39.0

Updated: 2017-11-29 04:19:57.0

Pushed: 2015-08-05 02:52:12.0

Homepage: null

Size: 570

Language: C

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ShenJS nodebots session instruction
Please note:

As many people really loved working with the mBot for NodeBots, the examples, drivers and firmware that have been developed have been moved to a new repository so that it can continue to be developed and improved. Ongoing development will continue at MakeBlock Official NodeBots.

Hardware mbot from makeblock

mBot is the easiest educational robot for kids to learn programming, Arduino and robotics.

mbot

Photo from Andrew Fisher

Getting started

Note that

  1. Install Arduino IDE
  2. Install Makeblock-USB-Driver Note for Mac users, use the driver included in this repo in the drivers folder as this one is signed. This step will reboot your computer
  3. Build the bot
  4. Install depedencies (I presume you already have nodejs + npm installed.)
clone git@github.com:jsconfcn/nodebots-session.git && cd nodebots-session
install
  1. Install fimata. Open arduino and navigage to firmware/mbotFirmata/mbotFirmata.ino and open it.

Compile and then upload to the board.

Examples

Examples are in the examples directory. You can run using node examples/file.js like normal. Information about the examples is below

Motors

Use examples/motors.js this will drive the mbot around using the arrow keys on your keyboard. You may need to change the details of the directions depending on how you wired up the motors.

Buzzer

Use examples/piezo.js - this will make your mbot play some tunes.

Obstacle detection

Use examples/sonar.js to detect the distance to an object. You can use this to stop your robot from running into this.

Button

Your mbot has a little button that you can use to trigger something maybe. Use examples/button.js to detect the button press and do something with it.

Light Sensor

You can read the light level near the mbot - maybe you can make your mbot run away from too much light or move towards more light? Use examples/light.js

LEDs

There are 2 LEDs on the mbot which are RGB LEDs. These are connected in a strip so you can use node-pixel to control them. An example is examples\leds.js

Reflectance sensor

Under your mbot is a sensor which you can use to detect lines. Look at examples\reflectance.js to see how to get the data. You can detect lines by getting one of the two sensors to be bright and one to be dark so it can follow an edge.

2.4GHz wireless module

Install using:

install drivers/node-hid

Run example

 examples/wifi_motors.js
Schedule
License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.