Grunt task for deploying to espruino javascript microcontroller.
~0.4.0
shell
npm install grunt-espruino --save-dev
`
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js
grunt.loadNpmTasks('grunt-espruino');
`
Espruino task
_Run this task with the grunt espruino command._
$3
There are a number of options available. Either boardSerial or port must be supplied, as well as file:
#### boardSerial
Type: String
This defines the manufacturer serial number of the board that we are deploying to. Can be pulled from the board over serial using getSerial() function.
#### port
Type: String
This defines the serial port that you want to deploy to. Not as fancy as using boardSerial but it works.
#### file
Type: String
Path to the file that you want deployed.
#### listen
Type: Boolean
Whether to leave the serial connection open after deploy and listen.
#### watch
Type: Boolean
If true watches file for any changes and redeploys.
#### save
Type: Boolean
If true uploaded code is saved to the espruinos flash. Set to false when in development for much shorter deploy times.
$3
`js
// Simple config to deploy to a single board
grunt.module.exports = function(grunt) {
grunt.initConfig({
espruino: {
upPin: {
boardSerial: '33FFD605-41573033-15720843',
file: 'upPin.espr.js'
}
}
});
grunt.loadNpmTasks('grunt-espruino');
grunt.registerTask('default', ['espruino']);
}
`
`js
// Development config, doesnt save so that deploys are faster. Watches for any changes and redeploys.
grunt.module.exports = function(grunt) {
grunt.initConfig({
espruino: {
upPin: {
boardSerial: '33FFD605-41573033-15720843',
file: 'upPin.espr.js',
save: false,
watch: true
}
}
});
grunt.loadNpmTasks('grunt-espruino');
grunt.registerTask('default', ['espruino']);
}
``