This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Adafruit_DotStar.h> | |
// There is only one pixel on the board | |
#define NUMPIXELS 1 | |
//Use these pin definitions for the ItsyBitsy M4 | |
#define DATAPIN 7 | |
#define CLOCKPIN 8 | |
Adafruit_DotStar strip(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BRG); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// following tracks | |
var track = []; | |
function setup() { | |
createCanvas(340, 340); | |
for (var x = width / 4; x < 3*width/4; x += 10) { | |
track.push({ | |
x: x, | |
y: height/4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "spaced colored squares" -- object edition | |
var squares = []; | |
function setup() { | |
colorMode(HSB); | |
noFill(); | |
for (var x = 50; x <= 250; x = x + 50) { | |
squares.push({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "spaced colored squares" -- array edition | |
colorMode(HSB); | |
noFill(); | |
var SIZE = 40; | |
var y = height/2 - SIZE/2; | |
var squares = [ | |
{ x: 50, y: y }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "spaced colored squares" -- array edition | |
colorMode(HSB); | |
noFill(); | |
var SIZE = 40; | |
var xs = [50, 100, 150, 200, 250]; | |
var y = height/2 - SIZE/2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "spaced colored squares" -- object edition | |
colorMode(HSB); | |
noFill(); | |
var SIZE = 40; | |
var squares = []; | |
for (var x = 50; x <= 250; x = x + 50) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function happyFace(x, y) { | |
// head | |
ellipse(x, y, 100, 100); | |
// eyes | |
ellipse(x-20, y-25, 20, 20); | |
ellipse(x+20, y-25, 20, 20); | |
// nose | |
line(x, y-20, x-10, y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var x = 10; x < width; x += 20) { | |
if (x < width/2) { | |
line(x, 10, x, height/2); | |
} else { | |
line(x, height-10, x, height/2); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var x = 10; x < width; x += 20) { | |
line(x, 10, x, height-10); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rect(70, 70, 200, 200); | |
rect(width/2 - 100, height/2 - 100, 200, 200); | |
var offset = 100; | |
rect(width/2 - offset, height/2 - offset, offset*2, offset*2); | |
offset = 90; | |
rect(width/2 - offset, height/2 - offset, offset*2, offset*2); |
NewerOlder