Yeoman generator for creating AngularJS web applications with Arduino - lets you quickly set up a project and upload it to your Arduino.
Forked from AngularJS Full-Stack generator
Source code: https://github.com/lasselukkari/angular-arduino-demo
First, you'll need to install
yo and other required tools:
npm install -g yo bower grunt-cli
npm install -g generator-angular-arduino
Make a new directory, and
cd into it:
mkdir my-new-project && cd $_
yo angular-arduino, optionally passing an app name:
yo angular-arduino [app-name]
grunt for building + uploading,
grunt serve for ui preview.
To build the project run
grunt build. The built project in dist/server is compatible with the Arduino IDE.
See generated grunt file for more available tasks.
Custom platform options can be set manually.
Arduino Uno is barely usable. On Uno the example project consumes almost all available memory resources. Remove Serial lib to free some space.
To enable the ESP8266 refer to github.com/esp8266/Arduino
A grunt task looks for new files in your
client/components folder and automatically injects them in the appropriate places based on an injection block.
Sets up a new AngularJS + aWOT app, generating all the boilerplate you need to get started.
Generates a new API endpoint.
yo angular-arduino:endpoint message [?] What will the url of your endpoint be? /api/messages
Generates a new route.
yo angular-arduino:route myroute [?] Where would you like to create this route? client/app/ [?] What will the url of your route be? /myroute
client/app/myroute/myroute.js client/app/myroute/myroute.controller.js client/app/myroute/myroute.controller.spec.js client/app/myroute/myroute.html client/app/myroute/myroute.scss
Generates a controller.
yo angular-arduino:controller user [?] Where would you like to create this controller? client/app/
Generates a directive.
yo angular-arduino:directive myDirective [?] Where would you like to create this directive? client/app/ [?] Does this directive need an external html file? Yes
client/app/myDirective/myDirective.directive.js client/app/myDirective/myDirective.directive.spec.js client/app/myDirective/myDirective.html client/app/myDirective/myDirective.scss
Simple directive without an html file
yo angular-arduino:directive simple [?] Where would you like to create this directive? client/app/ [?] Does this directive need an external html file? No
Generates a filter.
yo angular-arduino:filter myFilter [?] Where would you like to create this filter? client/app/
Generates an AngularJS service.
yo angular-arduino:service myService [?] Where would you like to create this service? client/app/
You can also do
yo angular-arduino:factory and
yo angular-arduino:provider for other types of services.
Generates an AngularJS service decorator.
yo angular-arduino:decorator serviceName [?] Where would you like to create this decorator? client/app/
The following packages are always installed by the app generator:
These packages are installed optionally depending on your configuration:
In index.html all dependencies are linked from CDN. Bower components are installed locally as a dev dependencies for running tests.
You can install bower components as normal dependencies but this will consume lots of valuable software memory.
Yeoman generated projects can be further tweaked according to your needs by modifying project files appropriately.
.yo-rc file is generated for helping you copy configuration across projects, and to allow you to keep track of your settings. You can change this as you see fit.
grunt test will run the client tests with karma and mocha.
├── client │ ├── app - All of our app specific components go in here │ ├── assets - Custom assets: fonts, images, etc… │ └── components - Our reusable components, non-specific to to our app │ └── server └── server.ino - Our main server Arduino sketch
An example client component in
main ├── main.js - Routes ├── main.controller.js - Controller for our main route ├── main.controller.spec.js - Test ├── main.html - View └── main.less - Styles
An example server component in
├── thing.route.ino - Routes └── thing.controller.ino - Controller for our `thing` endpoint
See the contributing docs
When submitting an issue, please follow the guidelines. Especially important is to make sure Yeoman is up-to-date, and providing the command or commands that cause the issue.
When submitting a PR, make sure that the commit messages match the AngularJS conventions.
When submitting a bugfix, try to write a test that exposes the bug and fails before applying your fix. Submit the test alongside the fix.
When submitting a new feature, add tests that cover the feature.
travis.yml for configuration required to run tests.