Click and drag your mouse (or finger on touch device) to draw a line. A new path is created for each touch or click.
Paths are stored in a nested array; you can inspect the variable in console: session (assuming the example is in it's own window).
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <style> | |
| body { | |
| margin: 30px; | |
| } | |
| </style> | |
| </head> | |
| <body> |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
| <head profile="http://selenium-ide.openqa.org/profiles/test-case"> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
| <link rel="selenium.base" href="http://www.washingtontimes.com/" /> | |
| <title>New Test</title> | |
| </head> | |
| <body> | |
| <table cellpadding="1" cellspacing="1" border="1"> |
| #include <Servo.h> | |
| Servo head; | |
| Servo leftArm; | |
| Servo rightArm; | |
| int headPosition = 90; | |
| int leftArmPosition = 90; | |
| int rightArmPosition = 90; |
| #include <Servo.h> | |
| Servo head; | |
| Servo leftArm; | |
| Servo rightArm; | |
| int headPosition = 90; | |
| int leftArmPosition = 90; | |
| int rightArmPosition = 90; |
| var sleep = require('sleep'); | |
| five = require("johnny-five"); | |
| ik = require("./ik"); | |
| board = new five.Board({ debug: false }); | |
| board.on("ready", function() { | |
| // Setup | |
| servo1 = five.Servo({ | |
| address: 0x40, | |
| controller: "PCA9685", |
| > var linesRaw = fs.readFileSync('lines.json', 'utf8'); | |
| > lines = JSON.parse(linesRaw) | |
| [ [ { x: 122.01388549804688, y: 183.01388549804688 }, | |
| { x: 119.01388549804688, y: 195.01388549804688 }, | |
| { x: 115.01388549804688, y: 307.0138854980469 }, | |
| { x: 115.01388549804688, y: 354.0138854980469 }, | |
| { x: 117.01388549804688, y: 360.0138854980469 } ], | |
| [ { x: 206.01388549804688, y: 177.01388549804688 }, | |
| { x: 204.01388549804688, y: 194.01388549804688 }, | |
| { x: 202.01388549804688, y: 287.0138854980469 }, |
| var centerX=0; | |
| var centerY=0; | |
| var radius=20; | |
| // an array to save your points | |
| var points=[]; | |
| // populate array with points along a circle | |
| for (var degree=0; degree<360; degree++){ | |
| var radians = degree * Math.PI/180; |
| /* | |
| // Usage: | |
| // motion.move(pointA, pointB, numberOfSteps, easingType, timeDeltaInMilliseconds) | |
| // Example | |
| $ node bot.js | |
| >> motion = require('./motion') | |
| >> motion.move([0,0,-140],[-20,20,-140], 20, 'easeInOutCubic', 500) | |
| >> motion.move([-20,60,-165],[-20,-60,-165], 30, 'easeInOutCubic', 20) | |
| >> motion.move([-20,-60,-165],[-20,60,-165], 30, 'easeInOutCubic', 20) |
| from random import randint | |
| problems = [] | |
| def print_problem(operation): | |
| a = randint(100000, 999999) | |
| b = randint(100000, 999999) | |
| if b > a: | |
| a,b = b,a |