Skip to content

Commit

Permalink
Merge pull request #2 from yammmt/gifter-labo
Browse files Browse the repository at this point in the history
位置補正追加、初期色をオレンジに変更
開始時に前進するように追加
  • Loading branch information
shundroid committed Feb 27, 2016
2 parents 148845b + 7455a02 commit c49fe50
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion backside.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ module.exports = {
var orb = sphero(port);
orb.connect(function() {
orb.detectCollisions(); // 衝突判定を有効化
callback(orb);
console.log("準備開始");
orb.startCalibration(); // 位置関係の補正
setTimeout(function() {
console.log("準備終了");
orb.finishCalibration();
callback(orb);
}, 10000);
});
orb.on("collision", function() {
raiseEvent("collision");
Expand Down
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var backside = require("./backside");

// 自分の Sphero の ID に置き換える
var port = "COM7";
var orbDefaultColor = "lightseagreen";
var orbDefaultColor = "orange";
var loopInterval = 1000;
var orb = {};

Expand All @@ -11,7 +11,7 @@ function connect() {
orb.color(orbDefaultColor);
setTimeout(loop, loopInterval);
// ここに処理を書きます

orb.roll(50,0);
// ここまで
}

Expand Down

0 comments on commit c49fe50

Please sign in to comment.