Shivani Kannan - Working with Outputs

Made by Shivani Kannan

Getting oriented with output and feedback by working with an actuator. Taking cues from Google's Paper Signals experiment with materials to create an interesting notification or effect when combined with the actuator.

Created: November 20th, 2024

0

Intention

Getting oriented with output and feedback by working with an actuator. Taking cues from Google's Paper Signals experiment with materials to create an interesting notification or effect when combined with the actuator.
I created a peek-a-boo cat that gets triggered by calling a function.

0

Process

  1. Setting up circuit & following along with the code from the tutorial videos to check if the Servo works
  2. Deciding what to create based on the limitations of the servo movement angle (can only go up to 180)
  3. Figuring out where to place the paper to get the desired 'peek-a-boo' effect
  4. Cutting out thick paper for the 'peek-a-boo' box.
  5. Sticking all things together. Attaching it to the servo
  6. Modifying code so the movement is from 90 to 180 degrees on calling a function.


0
// Include Particle Device OS APIs
#include "Particle.h"

int servoPin = A2;
Servo servo;
int defaultPosition = 90;  // Default position for the servo
int peekPosition = 180;    // Peek position for the servo

// Let Device OS manage the connection to the Particle Cloud
SYSTEM_MODE(AUTOMATIC);

// Show system, cloud connectivity, and application logs over USB
SerialLogHandler logHandler(LOG_LEVEL_INFO);

// setup() runs once, when the device is first turned on
void setup() {
  servo.attach(servoPin);           // Attach the servo to the pin
  servo.write(defaultPosition);     // Set the servo to the default position
  delay(500);                       // Allow the servo to settle
  Serial.println("Servo initialized to 90 degrees");
}

// loop() runs over and over again, as quickly as it can execute.
void loop() {
  // Keep the servo at 90 degrees by default
  servo.write(defaultPosition);
  delay(1000);

  // Call the peek function for demonstration
  peek();  // You can replace this with a condition or trigger
  delay(5000);  // Wait 5 seconds before next peek
}

// Function to move the servo to 180 degrees slowly
void peek() {
  Serial.println("Peeking...");
  
  for (int pos = defaultPosition; pos <= peekPosition; pos += 5) {  // Move in steps of 5 degrees
    servo.write(pos);  // Set the servo position
    delay(50);         // Delay for smooth movement
  }
  
  Serial.println("Peek complete");
}
Click to Expand
0

Outcome

A peek-a-boo cat that gets triggered by calling a function. It could be a way to cheer someone up randomly and remind them that they are awesome!

0
Peek-a-boo Cat using Servo
Shivani Kannan - https://youtube.com/shorts/7wA2C7KrSrs
0

Reflection

At the end I realized that the servo doesn't touch 180 (it stops right before it), when I made the cutout box & cut out of the cat, I didn't take that into account. I would have changed the size of the box and cat to accommodate that and give a more polished look.

x
Share this Project


About

Getting oriented with output and feedback by working with an actuator. Taking cues from Google's Paper Signals experiment with materials to create an interesting notification or effect when combined with the actuator.