Edit the module

This page allows you to edit the existing module (Grove PIR Motion Sensor).

Basic Information

Provide basic information of the module.

* Photo URLs that end with any one of .jpg, .jpeg, .png or that are uploaded to the Gyazo web service in the PNG format (e.g.https://gyazo.com/hogehoge) are supported.

Relevant URLs

Relevant URLs can be edited in the module page.

Layout information

Provide the source code of the module layout in JavaScript.

function BISS0001(pin) { this._name = function () { return 'BISS0001(' + this.pin + ')'; }; this._bounds = function () { return { x: -25, y: -15, width: 50, height: 30 }; }; this.value = function () { return 0; }; this._print = function (g, options) { g.drawCircle(20, 0, 1); g .drawCircle(-10, -10, 1); g.drawCircle(-10, +10, 1); g.drawCircle(13.5, 0, 6.5); g.drawRectangle(-19.5, -8.5, 10, 13); if (!options.print) { g.drawRectangle(-20, -10, 40, 20); g.drawCircle(20, 0, 2); g.drawCircle(-10, -10, 2); g.drawCircle(-10, 10, 2); g.drawText(this.getName(), -20, 10); } }; }
Layout
How to write code
  • First, define a function that represents this module.
  • Define methods _name, _bounds, _print within the class, where ...
  • _name method returns the name of the module for display.
  • _bounds method returns the bounding box of the module as a Rectangle instance.
  • _print method takes graphics context Graphics and printing options PrintOptions as its arguments.
More details can be found at the howto page.
Delete