Basic Information

This page allows you to fork a new project from an existing project (Lチカサンプル). The newly forked project will be listed in the IoT Projects page as a new entry. If you want to overwrite the existing project, please edit it instead.

* 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.

* Node.js entry point main: index.js and dependencies to the npm module dependencies: { f3js: (略) } will be automatically added and thus do not need to be in this form.

Card preview
'16/6/23 15:10

Private Project

Unchecking this will make the project public and be listed in the IoT Projects page. The checkbox is unchecked by default since we want you to share the projects! Additionally, you cannot check this unless you are logged in. Once you make the project public, it cannot be undone. (Any edits to the project except for forking will also be public.)

Source Code

Provide the source code of a microcontroller or tiny computer in JavaScript. Node.js-based computers are supported. Require f3js package and use its API to design the device enclosure.

// Load Grove module var groveSensor = require('jsupm_grove'); // Create the Grove LED object using GPIO pin 2 var led = new groveSensor.GroveLed(2); // Print the name console.log(led.name()); // Turn the LED on and off 10 times, pausing one second // between transitions var i = 0; var waiting = setInterval(function() { if ( i % 2 == 0 ) { led.on(); } else { led.off(); } i++; if ( i == 20 ) clearInterval(waiting); }, 1000); // Create a box to hold the LED var f3js = require('f3js') , x = 10 , y = 10 , width = 130 , height = 105 , thickness = 45; // put base board var rect = f3js.drawJointRectangle( x, y, width, height); f3js.add(led, x + width / 2, y + height / 2); // 配線穴 f3js.drawRectangle(x + width / 2 - 10, y + height / 2 + 20, 20, 10); var r = f3js.drawRectangle(x + width / 2 - 10, y + height / 2 - 30, 20, 10); r.stroke = false; r.fill = true; f3js.text("hoge", 100, 100); // put side boards var planes = rect.extrude(thickness); var margin = 5; planes[0].x = x; planes[0].y = y + height + margin; f3js.add(planes[0]); planes[1].x = x + width; planes[1].y = y + height + margin; f3js.add(planes[1]); planes[2].x = x + height; planes[2].y = y + height + thickness + margin; f3js.add(planes[2]); planes[3].x = x; planes[3].y = y + height + thickness + margin; f3js.add(planes[3]); planes[4].x = width; planes[4].y = 0; f3js.add(planes[4]); // put a side hall f3js.drawRectangle( x + 5, y + height + thickness * 2 + margin - dh - 15, height - 10, 10);
Customization

This content does not allow any customization.

Layout view options
Adding comments to variable declarations in the source code populate various GUI widgets in the "Customization" section depending on their types.

Design Alternatives

Modules

No modules are required for this project.

Layout
Program

Login first to use this feature.