xxxxxxxxxx
20
let r, g, b;
function setup() {
createCanvas(displayWidth, displayHeight);
r = random(50, 255);
g = random(0, 255);
b = random(50, 255);
}
function draw() {
background(r, g, b);
console.log('draw',r,g,b);
}
function deviceMoved() {
r = map(accelerationX, -90, 90, 0, 255);
g = map(accelerationY, -90, 90, 0, 255);
b = map(accelerationZ, -90, 90, 0, 255);
console.log(accelerationX,accelerationY,accelerationZ)
}