Published © CC BY-NC-SA

Cap of Sufficient Knowledge

Show off your sufficient knowledge with a custom graduation cap, inspired by the comic Strange Planet by Nathan Pyle.

BeginnerShowcase (no instructions)8 hours529

Things used in this project

Hardware components

Circuit Playground Express
Adafruit Circuit Playground Express
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Graduation Cap
×1
Felt
×1
Powerbank
×1

Software apps and online services

Arduino IDE
Arduino IDE
Adobe Illustrator
Fusion 360
Autodesk Fusion 360

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Code

graduationCap.ino

Arduino
Circuit Playground code
#include <Servo.h>
#include <Adafruit_CircuitPlayground.h>

Servo servo;

int pixel1;
int pixel2;

void setup() {

  CircuitPlayground.begin();
  servo.attach(12);

  pixel1 = 0;
  pixel2 = 5;
}

void loop() {
  servo.write(0);
  delay(1000);

  CircuitPlayground.clearPixels();
 
  // Turn on two pixels to COLOR
  CircuitPlayground.setPixelColor(pixel1, 0,0,255);
  CircuitPlayground.setPixelColor(pixel2, 128,0,128);
 
  // Increment pixels to move them around the board
  pixel1 = pixel1 + 1;
  pixel2 = pixel2 + 1;
 
  // Check pixel values
  if (pixel1 > 9) pixel1 = 0;
  if (pixel2 > 9) pixel2 = 0;


  servo.write(180);
  delay(1000);

  CircuitPlayground.clearPixels();
 
  // Turn on two pixels to COLOR
  CircuitPlayground.setPixelColor(pixel1, 0,0,255);
  CircuitPlayground.setPixelColor(pixel2, 128,0,128);
 
  // Increment pixels to move them around the board
  pixel1 = pixel1 + 1;
  pixel2 = pixel2 + 1;
 
  // Check pixel values
  if (pixel1 > 9) pixel1 = 0;
  if (pixel2 > 9) pixel2 = 0;
}

Credits

Comments