<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Cheska P on Medium]]></title>
        <description><![CDATA[Stories by Cheska P on Medium]]></description>
        <link>https://medium.com/@cheska.p?source=rss-1599a0efe8e9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*jycn8VEWKIuPRBeO</url>
            <title>Stories by Cheska P on Medium</title>
            <link>https://medium.com/@cheska.p?source=rss-1599a0efe8e9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 21:10:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cheska.p/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Kitchen Murder Mystery | Extra Lab: Capacitive Sensing]]></title>
            <link>https://medium.com/@cheska.p/kitchen-murder-mystery-extra-lab-capacitive-sensing-2d440b2a62e5?source=rss-1599a0efe8e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d440b2a62e5</guid>
            <dc:creator><![CDATA[Cheska P]]></dc:creator>
            <pubDate>Tue, 01 Dec 2026 06:42:37 GMT</pubDate>
            <atom:updated>2026-12-01T06:42:37.738Z</atom:updated>
            <content:encoded><![CDATA[<p>The goal of this lab was to create an interesting interaction with an everyday object using a capacitive sensor as input. Recently, I have been seeing a lot of reels about murder mystery games. I thought it would be interesting to make the murder weapon selection more tangible. Instead of clicking an object on a screen, the player would have to touch the actual object they wanted to accuse. It has the murder mystery experience, minus the deaths on my end.</p><p>Normally, a game like this would ask the player to click an image or press a key. With capacitive sensing, the object becomes the interface. Touching the scissors means accusing the scissors. Touching the pan means accusing the pan. There is less separation between the choice on the screen and the physical action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DoFfnfQASXFtFCXps0HAlA.png" /></figure><p>I chose three possible weapons: poisoned water, a pair of scissors, and a frying pan. They are all everyday objects that could also fit into an overly dramatic murder mystery. Each object was connected to its own receive pin through a 10 MΩ resistor. The three sensors shared the same send pin.</p><p>At first, the shared pin was a little confusing to me. I thought the receive pins might need to be connected directly to each other. Instead, the send pin branches out through three separate resistors. The other end of each resistor connects to a different receive pin and touch object. This lets the Arduino measure each object separately while still using the same send signal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-3mLVTbmhNkE74iVvKfCBQ.png" /></figure><p>The three objects did not respond with exactly the same range of values, so I gave them different thresholds. There was not one threshold that worked equally well for everything .The poisoned water counts as touched when its value is greater than 50. The scissors count as touched above 21, while the pan uses a threshold of 40.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lv_ltyiBG72ChJ4zl4qN4w.png" /></figure><p>On the p5.js side, the game secretly chooses one of the three objects as the correct weapon. The player sees all three pieces of evidence on the screen but does not know which one was selected. Touching one of the physical objects submits it as the accusation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3yIG7yTX8DT6xUPyfkHFZQ.png" /></figure><p>If the player chooses the correct object, the screen announces that the case is closed and plays a successful sound. If the guess is wrong, the game shows a false accusation, reveals the real weapon, and plays a lower incorrect sound. After that, the evidence is shuffled and a new weapon is selected for the next round.</p><p>Here’s a sample video of me guessing the murder weapon!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F1ygvuyVCq-o%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D1ygvuyVCq-o&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F1ygvuyVCq-o%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f11c94071069ce44a760f54f8c086e9d/href">https://medium.com/media/f11c94071069ce44a760f54f8c086e9d/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d440b2a62e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Letter with Personality | Final Project Proposal]]></title>
            <link>https://medium.com/@cheska.p/a-letter-with-personality-final-project-proposal-8e9ee90ade92?source=rss-1599a0efe8e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e9ee90ade92</guid>
            <dc:creator><![CDATA[Cheska P]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 23:41:49 GMT</pubDate>
            <atom:updated>2026-11-11T02:46:10.523Z</atom:updated>
            <content:encoded><![CDATA[<p>Jie (Jerry) Zhang, Dana (Cheska) Peralta, Lady Leggett, Qazybek Beken</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*a8HpmNhwZuTKdI7gJYBfHA.png" /></figure><p>For our final project, we started with thinking about what happens to a letter after someone receives it. The sender writes it with a particular person in mind, but once it arrives, the receiver decides where to keep it, when to read it again, and what it means to them. Over time, the letter holds memories of both the person who wrote it and the person who keeps it.</p><p>We wanted to explore what it would be like if the paper itself could become part of that relationship. What could it carry beyond the words someone writes?</p><h3>Paper for someone special</h3><p>We imagined this as paper you would choose for someone you feel close to. It doesn’t need to be for a birthday, wedding, graduation, or other celebration. It could hold an ordinary update, a story you wanted to share, or something that reminded you of them. We also thought about how friends sometimes pass a journal back and forth, adding little pieces of their lives along the way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DIFjy-HMwoz-zo-W-YAZGw.png" /></figure><p>The paper, heading, envelope, and even the way the letter is folded could help shape that experience. Before the receiver reads anything, these details already suggest that someone put thought into what they are holding.</p><h3>Giving the letter a personality</h3><p>We began exploring how the sender could leave something of themselves in the paper. A little vibration could feel like a giggle, while warmth could suggest affection or the feeling of sharing a piece of your heart. We also considered whether a short melody could accompany parts of the letter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*62cWiLlDV3QCm4Z6ddyZ-w.png" /></figure><p>But the same interaction might feel different depending on who sent it. A playful vibration might remind someone of an excited child, while that same movement could feel strange in a letter from their grandfather. We started wondering how these expressions could reflect the sender and their relationship with the receiver. One idea was an introductory sticker or stamp where the receiver could share who the letter is from.</p><h3>An envelope to come home to</h3><p>We also started thinking about the envelope as the letter’s home. Taking it out, unfolding it, and putting it away could become part of how the receiver gets to know its personality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eDyFG1UK4-UqpEApT11RPw.png" /></figure><p>We liked the idea that its personality could continue to develop through how it is handled and kept.</p><p>This also brought up questions about who shapes the experience. The sender might choose the feelings they want to share, but the receiver will be the one living with the letter. We want to explore how both people could contribute to what it becomes.</p><h3>Leaving a little presence behind</h3><p>After exploring these ideas, we decided to focus on creating a special paper with personality. We want to experiment with how the paper itself could create sound or move, perhaps humming when being read or shifting to ask for attention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*mj1W9yppxu_isgph.gif" /></figure><p>Alongside these physical interactions, we thought about ambient shadows appearing around the paper. These could suggest the sender’s hands writing or folding the letter, or small details from a place they wanted to share.</p><p>We imagined the shadows giving a sense of someone being nearby while the receiver reads or a shadow waving back when the receiver waves at it.</p><p>We’re currently exploring different ways we can create and interact with shadows. Will it be humans, the surrounding area, our hands, or other things?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*C3EBt3cVECsql6XI.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e9ee90ade92" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crawling Tarot | Lab 7: Servo Motors]]></title>
            <link>https://medium.com/@cheska.p/crawling-tarot-lab-7-servo-motors-1cce17ec70f6?source=rss-1599a0efe8e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cce17ec70f6</guid>
            <dc:creator><![CDATA[Cheska P]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 11:37:18 GMT</pubDate>
            <atom:updated>2026-10-21T11:37:18.207Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*3b09lARkgxFtddeeWptZWQ.png" /></figure><p>For this lab, we were tasked with creating a crawler using a servo motor without using wheels. I started with the provided Arduino code that used a potentiometer to control the position of a servo motor. By turning the potentiometer, I could control how far the servo rotated.</p><p>Since the code was already given, I focused on figuring out different ways to turn the servo’s movements into forward motion without using wheels. After a few attempts, I managed to get two versions working.</p><p>For my first working version, I gave the crawler little “legs” that it could shuffle with. The problem was that the movement would sometimes just slide the crawler back and forth without actually moving it forward.</p><p>To help with this, I attached some double-sided tape to the feet. This gave them just enough grip on the table to push the crawler forward instead of simply sliding back.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FhU6e-YDpAmI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2FhU6e-YDpAmI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FhU6e-YDpAmI%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6aed1055bf5833b0bfc89e773fd3702/href">https://medium.com/media/d6aed1055bf5833b0bfc89e773fd3702/href</a></iframe><p>For my second version, I changed the orientation of the servo and laid it sideways. Instead of the previous setup with chopsticks attached to a longer stick, I used just one long stick attached to the servo.</p><p>Surprisingly, this worked too! The crawler would waddle forward, although the movement was very slight.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FtrSYZwG51M0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2FtrSYZwG51M0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FtrSYZwG51M0%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/868997514c5e6539d4f87502a706142f/href">https://medium.com/media/868997514c5e6539d4f87502a706142f/href</a></iframe><p>With Halloween coming up, I thought it would be fun to turn my crawler into something a little spooky. Wouldn’t it be lovely if your tarot card set could just magically crawl toward you?</p><p>I decided to use the second version of my crawler and cover it with a tarot cover. However, the little movements that worked for the earlier version weren’t quite enough once I added the cover. I had to make the servo and stick move bigger to get the tarot cover crawling forward.</p><p>And there it was, a tarot card set that could slowly crawl toward you.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F51PSv8pTpsU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2F51PSv8pTpsU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F51PSv8pTpsU%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/abe696cd5ced171461af60fb9ea46f9a/href">https://medium.com/media/abe696cd5ced171461af60fb9ea46f9a/href</a></iframe><p><strong>Components</strong></p><ul><li>1 Arduino</li><li>1 Potentiometer</li><li>1 Servo Motor</li><li>A couple sticks of choice</li><li>Tape (regular and double sided)</li><li>Tarot set cover</li></ul><p><strong>Code</strong></p><p>I used the given code with the potentiometer.</p><pre><br>#include &lt;Servo.h&gt;<br><br>Servo servo; <br><br>int potpin = 0;<br>int servopin = 7;<br>int val;<br><br>void setup() {<br>  servo.attach(servopin); <br>}<br><br>void loop() {<br>  val = analogRead(potpin);          <br>  val = map(val, 0, 1023, 0, 180);     <br>  servo.write(val);                  <br>  delay(15);                         <br>}</pre><p><strong>Schematic Diagram</strong></p><p>I used <a href="https://www.tinkercad.com/">Tinkercad</a> for this!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MhkKfXHnr3aYTYyBQ2bMMg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cce17ec70f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Orb: A Calm Way to Feel Close | Progress Sketches]]></title>
            <link>https://medium.com/@cheska.p/midterm-proposal-progress-sketches-27648b02fc13?source=rss-1599a0efe8e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/27648b02fc13</guid>
            <dc:creator><![CDATA[Cheska P]]></dc:creator>
            <pubDate>Tue, 13 Oct 2026 06:08:09 GMT</pubDate>
            <atom:updated>2026-10-13T06:18:36.546Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Members:</strong> Jerry, Cheska, Lady, Qazybek</p><p>For our midterm project, we moved away from our original idea and started thinking about how else we could help people feel closer when they live apart. We wanted to explore something that could fit naturally into someone’s home.</p><p>That’s how we came up with a connected orb lamp for people in long-distance relationships. The idea is to share little moments of everyday life through light and voice. We started thinking about what it would be like to notice your partner’s presence in your own home, even when they’re somewhere else.</p><p>Here are a few interactions we’ve been exploring!</p><h4><strong>Presence through color</strong></h4><p>The first interaction focuses on a non-intrusive way of communicating presence. A connected wearable detects which room you’re in and communicates that information to the Orb in your partner’s corresponding room. Each person has their own designated color, so the light gives a small indication of where their partner is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yX98vwmru0BLY8xyBmLvqA.png" /></figure><p>We’re exploring the idea of being able to sense someone’s presence without having to ask what they’re doing. When you walk into your kitchen to make breakfast, your partner’s home has their kitchen Orb change from warm yellow to your assigned color (think yellow -&gt; blue). When you leave the kitchen to the living room, their kitchen Orb reverts back to yellow and their living room Orb now switches to your assigned color.</p><h4>Sending a voice message</h4><p>The second interaction allows someone to leave a short voice message for their partner. This interaction was inspired by the little ways my partner and I communicate when we are apart but still on a video call. Sometimes, he would shout from another room so his voice could reach his laptop, where I was waiting on the other end of the call. It reminded me of how we used to let each other know where we were in the house, calling out casually from one room to another.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nNXGwsTe1EQSl039bqdBeQ.png" /></figure><p>We wanted to bring that feeling into the Orb. By pressing and holding its button, someone can record a short voice message, which then plays from the corresponding Orb in their partner’s home. It could be something as simple as “I’m in the kitchen!” or a quick comment they would otherwise call out across the house.</p><h4>Getting a Sense of Their Day</h4><p>The third interaction was changing the brightness of the lights depending on the other’s local time. When you live in different time zones, it’s easy to forget that your partner might be starting their morning while you’re getting ready for bed. We wondered if Orb could give a subtle sense of what their environment is like, without needing to display a clock.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UaeABBIYDEOI4DZKpp2rmA.png" /></figure><p>A brighter glow could suggest daytime, while a dimmer glow could suggest nighttime. During the night, the light should stay soft enough to be sleep-friendly. This way, we can get a sense of what time of day it is for our partner, even when they aren’t there.</p><p>For example, as you’re getting ready to sleep, you might notice that their Orb is still glowing relatively bright. It reminds you that they’re probably still at work or out meeting friends while yours is coming to an end.</p><h4>Indicating Sleep</h4><p>The last interaction we thought about was knowing when the other person is sleeping. When they come back from work and it’s night at your place, they want to reach out but are afraid of waking you up if you are asleep.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8m7GYjTwsdNkYkz-hIZrMg.png" /></figure><p>With the connected wearable, Orb could detect when you’re asleep and shift into a different light pattern. We’re imagining a slow, breathing-like rhythm, where the light gently brightens and dims every few seconds while keeping their designated color. When you wake up, the Orb returns to its normal non-breathing state.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27648b02fc13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Steak Timer Buzzes Now | Lab 6: DC Motors]]></title>
            <link>https://medium.com/@cheska.p/steak-timer-buzzes-now-lab-6-dc-motors-481c5b8c771d?source=rss-1599a0efe8e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/481c5b8c771d</guid>
            <dc:creator><![CDATA[Cheska P]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 20:01:15 GMT</pubDate>
            <atom:updated>2026-10-12T20:10:58.781Z</atom:updated>
            <content:encoded><![CDATA[<p>The goal of this week’s lab was to work with a DC motor. During our discussion about motors, I was intrigued by how the movement of a motor is what creates the vibration in our phones and other smart objects. Instead of using the motor to move something from one place to another, I decided to use vibration as the goal for this lab.</p><p>Vibration has always been important for my own alarms. If I do not put my phone on my bed, I can easily sleep through an alarm when I am deeply asleep. If I place it on the bed, the vibration moves through the mattress and helps wake me up. My sleepy brain may ignore the sound, but the physical movement of the vibration is much harder for me to ignore. I wanted to bring that same idea into my <a href="https://medium.com/@cheska.p/steak-timer-lab-5-piezo-speakers-7a0db660dddf">previous lab</a>, a steak timer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CHK2Wvka5vebiKY7dJazhQ.jpeg" /></figure><p>The steak timer allows me to select a desired doneness level using a potentiometer: rare, medium-rare, medium, medium-well, or well-done. A force-sensitive resistor (FSR) confirms the selection and allows the user to navigate through the different cooking steps. While the timer is running, an LED remains on. Once the timer finishes, the LED begins blinking, and a piezo speaker plays a Cooking Mama-inspired sound to alert the user that the steak is ready.</p><p>After using it, I felt like it needed more tactile feedback. In the doneness selection screen, it showed when the selected doneness changed but turning the potentiometer did not physically feel like anything had happened. The FSR had a similar problem. Pressing it changed the screen, but the sensor itself did not click like a regular button. It was sometimes difficult to tell whether I had pressed hard enough or whether the input had registered besides looking at the screen.</p><p>The LED and piezo buzzer helped with telling me the timer has finished, but I also wanted another way to get the my attention when the steak was ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*szY7Yc4RaCBdS4CnHvpT7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*xz9wFyf3nA3L61K49pEZog.png" /><figcaption>The changing screens in the previous lab was the only was I know if the input was successfully registered.</figcaption></figure><p>I decided on using different vibration patterns for navigating, pressing the FSR, and finishing a timer.</p><p>The first vibration happens while navigating through the steak settings. Every time the potentiometer moves into a different doneness range, the motor gives one short buzz. A single short buzz works because it behaves more like a small click. Turn the potentiometer, enter a new setting, feel the buzz, and stop.</p><p>I then added an even shorter buzz whenever the FSR is pressed. Since an FSR responds to pressure instead of physically clicking, this vibration gives it the tactile feedback that it was missing compared to a button. The short buzz confirms that the press was detected and that the interface is moving to the next step. This became especially useful while moving through the prep instructions because I no longer had to rely only on the screen to know that my input worked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rhiMAiESwGgLRcgEd-vN-g.png" /><figcaption>I taped the dc motor under my table so it could give me the buzz I needed. It was also important how much of the little bit was touching the table. It dictated how much vibration gets kept and the volume of the sound created from the vibration.</figcaption></figure><p>For the finished timer, I wanted the vibration to feel noticeably different and urgent. I made the motor stronger and set it to pulsate instead of playing once. The stronger repeated pattern was meant to get my attention like a phone alarm. It continues until the I presses the FSR and then moves to the next step.</p><p>My finished timer signal now has multiple ways to alert me it is done. When a timer finishes, the red LED blinks, the piezo buzzer plays its sound, and the motor starts pulsing. With this, I hopefully won’t have “congratulations” level of steak.</p><p>Here’s the updated steak timer in action. You might have to bring your volume up to hear the selection and press vibrations. I promise it’s more obvious in person!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FA6ooA4qiK7A%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DA6ooA4qiK7A&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FA6ooA4qiK7A%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b88e65f334463af871d7e69350b456e7/href">https://medium.com/media/b88e65f334463af871d7e69350b456e7/href</a></iframe><p><strong>Code</strong></p><p>AI-generated code! I thought out the things I needed and did a plan -&gt; build workflow for my code. These are are my identified changes:</p><ul><li>New DC motor at pin 10</li><li>Vibrations at different strengths: mild (100), strong (200)</li><li>Vibrations at different lengths: tap (very short single buzz), steak doneness selection (short single buzz), alarm (pulsating buzz until acknowledged)</li><li>DC motor will be used to give tactile feedback for the steak doneness selection and FSR; should match the blinking light for pulsating buzz. (meaning the AI has to take into account the exisitng FSR, Potentiometer, and LED code!)</li></ul><p>Here’s the updated Arduino Code.</p><pre>const int FSR_PIN = A0;<br>const int POT_PIN = A1;<br>const int LED_PIN = 9;<br>const int PIEZO_PIN = 8;<br>const int MOTOR_PIN = 10;<br><br>const int MILD_VIBRATION = 100;<br>const int STRONG_VIBRATION = 200;<br>const unsigned long MILD_PULSE_MS = 140;<br>const unsigned long TAP_PULSE_MS = 70;<br>const unsigned long ALARM_ON_MS = 300;<br>const unsigned long ALARM_OFF_MS = 180;<br><br>enum LedMode { LED_OFF, LED_ON, LED_BLINK };<br>LedMode ledMode = LED_OFF;<br><br>enum MotorMode { MOTOR_OFF, MOTOR_MILD, MOTOR_ALARM };<br>MotorMode motorMode = MOTOR_OFF;<br><br>unsigned long lastPrint = 0;<br>unsigned long lastBlink = 0;<br>bool blinkOn = false;<br><br>unsigned long motorChangedAt = 0;<br>unsigned long motorPulseDuration = MILD_PULSE_MS;<br>bool motorPulseOn = false;<br><br>const int MELODY_NOTES[] = {<br>  659, 784, 880, 784, 659, 587, 659,<br>  784, 880, 988, 880, 784, 659<br>};<br>const int MELODY_DURATIONS[] = {<br>  140, 140, 280, 140, 140, 280, 140,<br>  140, 280, 280, 140, 140, 420<br>};<br>const int MELODY_NOTE_COUNT = 13;<br>const unsigned long MELODY_GAP_MS = 30;<br><br>bool melodyPlaying = false;<br>bool melodyNoteActive = false;<br>int melodyNoteIndex = 0;<br>unsigned long melodyPhaseStartedAt = 0;<br><br>String incoming = &quot;&quot;;<br><br>void setup() {<br>  Serial.begin(9600);<br>  pinMode(LED_PIN, OUTPUT);<br>  pinMode(PIEZO_PIN, OUTPUT);<br>  pinMode(MOTOR_PIN, OUTPUT);<br>  digitalWrite(LED_PIN, LOW);<br>  analogWrite(MOTOR_PIN, 0);<br>}<br><br>void loop() {<br>  while (Serial.available() &gt; 0) {<br>    char c = (char)Serial.read();<br>    if (c == &#39;\n&#39; || c == &#39;\r&#39;) {<br>      if (incoming.length() &gt; 0) {<br>        handleCommand(incoming);<br>        incoming = &quot;&quot;;<br>      }<br>    } else {<br>      incoming += c;<br>      if (incoming.length() &gt; 64) {<br>        incoming = &quot;&quot;;<br>      }<br>    }<br>  }<br><br>  unsigned long now = millis();<br><br>  updateLed(now);<br>  updateMotor(now);<br>  updateMelody(now);<br><br>  if (now - lastPrint &gt;= 40) {<br>    lastPrint = now;<br>    Serial.print(&quot;fsr: &quot;);<br>    Serial.println(analogRead(FSR_PIN));<br>    Serial.print(&quot;potentiometer: &quot;);<br>    Serial.println(analogRead(POT_PIN));<br>  }<br>}<br><br>void handleCommand(String line) {<br>  line.trim();<br>  int colon = line.indexOf(&#39;:&#39;);<br>  if (colon &lt; 0) {<br>    return;<br>  }<br><br>  String name = line.substring(0, colon);<br>  String value = line.substring(colon + 1);<br>  name.trim();<br>  value.trim();<br>  name.toLowerCase();<br>  value.toLowerCase();<br><br>  if (name == &quot;led&quot;) {<br>    if (value == &quot;off&quot;) {<br>      setLedMode(LED_OFF);<br>    } else if (value == &quot;on&quot;) {<br>      setLedMode(LED_ON);<br>    } else if (value == &quot;blink&quot;) {<br>      setLedMode(LED_BLINK);<br>    }<br>  } else if (name == &quot;piezo&quot; &amp;&amp; value == &quot;done&quot;) {<br>    startDoneMelody();<br>  } else if (name == &quot;motor&quot;) {<br>    if (value == &quot;mild&quot;) {<br>      startMildVibration();<br>    } else if (value == &quot;tap&quot;) {<br>      startTapVibration();<br>    } else if (value == &quot;alarm&quot;) {<br>      startAlarmVibration();<br>    } else if (value == &quot;off&quot;) {<br>      stopMotor();<br>    }<br>  }<br>}<br><br>void setLedMode(LedMode nextMode) {<br>  ledMode = nextMode;<br>  if (ledMode == LED_OFF) {<br>    blinkOn = false;<br>    digitalWrite(LED_PIN, LOW);<br>  } else if (ledMode == LED_ON) {<br>    blinkOn = true;<br>    digitalWrite(LED_PIN, HIGH);<br>  } else {<br>    blinkOn = true;<br>    lastBlink = millis();<br>    digitalWrite(LED_PIN, HIGH);<br>  }<br>}<br><br>void updateLed(unsigned long now) {<br>  if (ledMode == LED_BLINK &amp;&amp; now - lastBlink &gt;= 400) {<br>    lastBlink = now;<br>    blinkOn = !blinkOn;<br>    digitalWrite(LED_PIN, blinkOn ? HIGH : LOW);<br>  }<br>}<br><br>void startMildVibration() {<br>  startShortVibration(MILD_PULSE_MS);<br>}<br><br>void startTapVibration() {<br>  startShortVibration(TAP_PULSE_MS);<br>}<br><br>void startShortVibration(unsigned long duration) {<br>  motorMode = MOTOR_MILD;<br>  motorChangedAt = millis();<br>  motorPulseDuration = duration;<br>  motorPulseOn = true;<br>  analogWrite(MOTOR_PIN, MILD_VIBRATION);<br>}<br><br>void startAlarmVibration() {<br>  motorMode = MOTOR_ALARM;<br>  motorChangedAt = millis();<br>  motorPulseOn = true;<br>  analogWrite(MOTOR_PIN, STRONG_VIBRATION);<br>}<br><br>void stopMotor() {<br>  motorMode = MOTOR_OFF;<br>  motorPulseOn = false;<br>  analogWrite(MOTOR_PIN, 0);<br>}<br><br>void updateMotor(unsigned long now) {<br>  if (motorMode == MOTOR_MILD &amp;&amp; now - motorChangedAt &gt;= motorPulseDuration) {<br>    stopMotor();<br>    return;<br>  }<br><br>  if (motorMode != MOTOR_ALARM) {<br>    return;<br>  }<br><br>  unsigned long phaseDuration = motorPulseOn ? ALARM_ON_MS : ALARM_OFF_MS;<br>  if (now - motorChangedAt &gt;= phaseDuration) {<br>    motorChangedAt = now;<br>    motorPulseOn = !motorPulseOn;<br>    analogWrite(MOTOR_PIN, motorPulseOn ? STRONG_VIBRATION : 0);<br>  }<br>}<br><br>void startDoneMelody() {<br>  noTone(PIEZO_PIN);<br>  melodyPlaying = true;<br>  melodyNoteActive = true;<br>  melodyNoteIndex = 0;<br>  melodyPhaseStartedAt = millis();<br>  tone(<br>    PIEZO_PIN,<br>    MELODY_NOTES[melodyNoteIndex],<br>    MELODY_DURATIONS[melodyNoteIndex]<br>  );<br>}<br><br>void updateMelody(unsigned long now) {<br>  if (!melodyPlaying) {<br>    return;<br>  }<br><br>  if (<br>    melodyNoteActive &amp;&amp;<br>    now - melodyPhaseStartedAt &gt;= (unsigned long)MELODY_DURATIONS[melodyNoteIndex]<br>  ) {<br>    noTone(PIEZO_PIN);<br>    melodyNoteActive = false;<br>    melodyPhaseStartedAt = now;<br>    return;<br>  }<br><br>  if (!melodyNoteActive &amp;&amp; now - melodyPhaseStartedAt &gt;= MELODY_GAP_MS) {<br>    melodyNoteIndex++;<br>    if (melodyNoteIndex &gt;= MELODY_NOTE_COUNT) {<br>      melodyPlaying = false;<br>      noTone(PIEZO_PIN);<br>      return;<br>    }<br><br>    melodyNoteActive = true;<br>    melodyPhaseStartedAt = now;<br>    tone(<br>      PIEZO_PIN,<br>      MELODY_NOTES[melodyNoteIndex],<br>      MELODY_DURATIONS[melodyNoteIndex]<br>    );<br>  }<br>}</pre><p>Here’s the updated sketch.js code</p><pre>const FSR_THRESHOLD = 400;<br>const BAUD_RATE = 9600;<br><br>const DONENESS = [<br>  { id: &quot;rare&quot;, label: &quot;Rare&quot;, cook: 2.5 * 60 * 1000, demo: 6000 },<br>  { id: &quot;medium-rare&quot;, label: &quot;Medium-rare&quot;, cook: 3.5 * 60 * 1000, demo: 8000 },<br>  { id: &quot;medium&quot;, label: &quot;Medium&quot;, cook: 4.5 * 60 * 1000, demo: 10000 },<br>  { id: &quot;medium-well&quot;, label: &quot;Medium-well&quot;, cook: 5.5 * 60 * 1000, demo: 12000 },<br>  { id: &quot;well&quot;, label: &quot;Well-done&quot;, cook: 6.5 * 60 * 1000, demo: 14000 },<br>];<br><br>const REST = { cook: 5 * 60 * 1000, demo: 8000 };<br><br>const PREP = [<br>  {<br>    id: &quot;season&quot;,<br>    title: &quot;Season it&quot;,<br>    copy: &quot;Pat dry, then salt both sides generously.&quot;,<br>  },<br>  {<br>    id: &quot;pan&quot;,<br>    title: &quot;Grab a pan&quot;,<br>    copy: &quot;Use a heavy skillet. Cast iron is ideal.&quot;,<br>  },<br>  {<br>    id: &quot;oil&quot;,<br>    title: &quot;Add oil&quot;,<br>    copy: &quot;A thin coat of high-heat oil. Just enough to shimmer.&quot;,<br>  },<br>  {<br>    id: &quot;heat&quot;,<br>    title: &quot;Heat it up&quot;,<br>    copy: &quot;Wait until the pan is ripping hot, then lay the steak down.&quot;,<br>  },<br>];<br><br>let serialStatus = &quot;disconnected&quot;;<br>let serialWriter = null;<br>let serialBuffer = &quot;&quot;;<br>let lastSerialLine = &quot;&quot;;<br><br>let sensors = { fsr: 0, potentiometer: 512 };<br>let fsrWasDown = false;<br>let keyboardFsrPulse = false;<br><br>let demoMode = true;<br>let screen = &quot;select&quot;;<br>let selectedIndex = 2;<br>let prepIndex = 0;<br><br>let timerStartedAt = 0;<br>let timerDuration = 0;<br>let timerFinished = false;<br>let timerAlerted = false;<br>let currentLed = &quot;&quot;;<br><br>function setup() {<br>  createCanvas(windowWidth, windowHeight);<br>  textFont(&quot;Georgia&quot;);<br><br>  const connectButton = createButton(&quot;Connect to Arduino&quot;);<br>  connectButton.position(12, 12);<br>  connectButton.mousePressed(initSerial);<br>}<br><br>function windowResized() {<br>  resizeCanvas(windowWidth, windowHeight);<br>}<br><br>async function initSerial() {<br>  if (!navigator.serial) {<br>    serialStatus = &quot;error: Web Serial needs Chrome or Edge&quot;;<br>    return;<br>  }<br><br>  try {<br>    const port = await navigator.serial.requestPort();<br>    await port.open({ baudRate: BAUD_RATE });<br>    serialStatus = &quot;connected&quot;;<br><br>    const encoder = new TextEncoderStream();<br>    encoder.readable.pipeTo(port.writable);<br>    serialWriter = encoder.writable.getWriter();<br><br>    const decoder = new TextDecoderStream();<br>    port.readable.pipeTo(decoder.writable);<br>    const reader = decoder.readable.getReader();<br><br>    function scheduleRead() {<br>      reader.read().then(({ value, done }) =&gt; {<br>        if (done) {<br>          serialStatus = &quot;disconnected&quot;;<br>          serialWriter = null;<br>          return;<br>        }<br>        if (value) {<br>          ingestSerialChunk(value);<br>        }<br>        scheduleRead();<br>      });<br>    }<br>    scheduleRead();<br>  } catch (err) {<br>    serialStatus = &quot;error: &quot; + err.message;<br>  }<br>}<br><br>function ingestSerialChunk(chunk) {<br>  serialBuffer += chunk.replace(/\r/g, &quot;&quot;);<br>  let newline = serialBuffer.indexOf(&quot;\n&quot;);<br>  while (newline &gt;= 0) {<br>    const line = serialBuffer.slice(0, newline).trim();<br>    serialBuffer = serialBuffer.slice(newline + 1);<br>    if (line) {<br>      handleSerialLine(line);<br>    }<br>    newline = serialBuffer.indexOf(&quot;\n&quot;);<br>  }<br>}<br><br>function handleSerialLine(line) {<br>  lastSerialLine = line;<br>  const colon = line.indexOf(&quot;:&quot;);<br>  if (colon &lt; 0) {<br>    return;<br>  }<br>  const name = line.slice(0, colon).trim().toLowerCase();<br>  const value = Number(line.slice(colon + 1).trim());<br>  if (Number.isNaN(value)) {<br>    return;<br>  }<br>  if (name === &quot;fsr&quot;) {<br>    sensors.fsr = value;<br>  } else if (name === &quot;potentiometer&quot;) {<br>    sensors.potentiometer = value;<br>  }<br>}<br><br>function sendCommand(line) {<br>  if (!serialWriter) {<br>    return;<br>  }<br>  serialWriter.write(line + &quot;\n&quot;).catch((err) =&gt; {<br>    serialStatus = &quot;error: &quot; + err.message;<br>  });<br>}<br><br>function setLed(mode) {<br>  if (currentLed === mode) {<br>    return;<br>  }<br>  currentLed = mode;<br>  sendCommand(&quot;led: &quot; + mode);<br>}<br><br>function draw() {<br>  background(28, 22, 18);<br>  updateInputs();<br><br>  if (screen === &quot;select&quot;) {<br>    drawSelect();<br>  } else if (screen === &quot;prep&quot;) {<br>    drawPrep();<br>  } else if (screen === &quot;sideA&quot; || screen === &quot;sideB&quot;) {<br>    drawTimerScreen();<br>  } else {<br>    drawRestScreen();<br>  }<br><br>  drawHud();<br>}<br><br>function updateInputs() {<br>  if (screen === &quot;select&quot;) {<br>    const pot = constrain(sensors.potentiometer, 0, 1023);<br>    const nextIndex = constrain(<br>      floor(map(pot, 0, 1024, 0, DONENESS.length)),<br>      0,<br>      DONENESS.length - 1<br>    );<br>    if (nextIndex !== selectedIndex) {<br>      selectedIndex = nextIndex;<br>      sendCommand(&quot;motor: mild&quot;);<br>    }<br>  }<br><br>  if (isTimerScreen()) {<br>    updateTimer();<br>  }<br><br>  const fsrDown = sensors.fsr &gt;= FSR_THRESHOLD;<br>  const fsrPressed = (!fsrWasDown &amp;&amp; fsrDown) || keyboardFsrPulse;<br>  fsrWasDown = fsrDown;<br>  keyboardFsrPulse = false;<br>  if (fsrPressed) {<br>    onConfirm();<br>    sendCommand(&quot;motor: tap&quot;);<br>  }<br>}<br><br>function onConfirm() {<br>  if (screen === &quot;select&quot;) {<br>    prepIndex = 0;<br>    screen = &quot;prep&quot;;<br>    sendCommand(&quot;motor: off&quot;);<br>    setLed(&quot;off&quot;);<br>    return;<br>  }<br><br>  if (screen === &quot;prep&quot;) {<br>    if (prepIndex &lt; PREP.length - 1) {<br>      prepIndex += 1;<br>    } else {<br>      startSide(&quot;sideA&quot;);<br>    }<br>    return;<br>  }<br><br>  if (screen === &quot;sideA&quot;) {<br>    if (timerFinished) {<br>      startSide(&quot;sideB&quot;);<br>    }<br>    return;<br>  }<br><br>  if (screen === &quot;sideB&quot;) {<br>    if (timerFinished) {<br>      startTimer(&quot;done&quot;, restDuration());<br>    }<br>    return;<br>  }<br><br>  if (screen === &quot;done&quot;) {<br>    if (timerFinished) {<br>      screen = &quot;select&quot;;<br>      sendCommand(&quot;motor: off&quot;);<br>      setLed(&quot;off&quot;);<br>    }<br>  }<br>}<br><br>function isTimerScreen() {<br>  return screen === &quot;sideA&quot; || screen === &quot;sideB&quot; || screen === &quot;done&quot;;<br>}<br><br>function startSide(nextScreen) {<br>  startTimer(nextScreen, sideDuration());<br>}<br><br>function startTimer(nextScreen, duration) {<br>  sendCommand(&quot;motor: off&quot;);<br>  screen = nextScreen;<br>  timerDuration = duration;<br>  timerStartedAt = millis();<br>  timerFinished = false;<br>  timerAlerted = false;<br>  setLed(&quot;on&quot;);<br>}<br><br>function sideDuration() {<br>  const level = DONENESS[selectedIndex];<br>  return demoMode ? level.demo : level.cook;<br>}<br><br>function restDuration() {<br>  return demoMode ? REST.demo : REST.cook;<br>}<br><br>function activeDuration() {<br>  return screen === &quot;done&quot; ? restDuration() : sideDuration();<br>}<br><br>function updateTimer() {<br>  const remaining = timerDuration - (millis() - timerStartedAt);<br>  if (remaining &gt; 0) {<br>    return;<br>  }<br>  timerFinished = true;<br>  if (!timerAlerted) {<br>    timerAlerted = true;<br>    setLed(&quot;blink&quot;);<br>    sendCommand(&quot;piezo: done&quot;);<br>    sendCommand(&quot;motor: alarm&quot;);<br>  }<br>}<br><br>function remainingMs() {<br>  return max(0, timerDuration - (millis() - timerStartedAt));<br>}<br><br>function keyPressed() {<br>  if (key === &quot; &quot; || keyCode === ENTER) {<br>    keyboardFsrPulse = true;<br>    return false;<br>  }<br>  if (key === &quot;d&quot; || key === &quot;D&quot;) {<br>    demoMode = !demoMode;<br>    if (isTimerScreen()) {<br>      const elapsed = millis() - timerStartedAt;<br>      const progress = timerDuration === 0 ? 0 : elapsed / timerDuration;<br>      timerDuration = activeDuration();<br>      timerStartedAt = millis() - progress * timerDuration;<br>      if (!timerFinished &amp;&amp; remainingMs() &lt;= 0) {<br>        timerFinished = true;<br>      }<br>    }<br>    return;<br>  }<br>  const num = int(key);<br>  if (num &gt;= 1 &amp;&amp; num &lt;= 5) {<br>    sensors.potentiometer = map(num - 1, 0, DONENESS.length - 1, 80, 940);<br>  }<br>}<br><br>function drawHud() {<br>  noStroke();<br>  fill(214, 186, 150);<br>  textAlign(LEFT, TOP);<br>  textSize(13);<br>  textFont(&quot;Helvetica&quot;);<br>  const modeLabel = demoMode ? &quot;DEMO times&quot; : &quot;COOK times&quot;;<br>  const line2 = lastSerialLine ? &quot;  ·  &quot; + lastSerialLine : &quot;&quot;;<br>  text(serialStatus + line2, 12, 48);<br>  text(modeLabel + &quot;  ·  D toggles  ·  Space = FSR  ·  1–5 doneness&quot;, 12, height - 36);<br>  textFont(&quot;Georgia&quot;);<br>}<br><br>function drawSelect() {<br>  noStroke();<br>  fill(245, 232, 214);<br>  textAlign(CENTER, TOP);<br>  textSize(42);<br>  text(&quot;Steak Timer&quot;, width / 2, 72);<br>  textSize(18);<br>  fill(214, 186, 150);<br>  text(&quot;Turn the potentiometer. Press the FSR to choose.&quot;, width / 2, 124);<br><br>  const cardW = min(160, (width - 120) / DONENESS.length);<br>  const gap = 18;<br>  const totalW = DONENESS.length * cardW + (DONENESS.length - 1) * gap;<br>  const startX = (width - totalW) / 2;<br>  const y = height / 2 - 20;<br><br>  for (let i = 0; i &lt; DONENESS.length; i++) {<br>    const x = startX + i * (cardW + gap);<br>    const selected = i === selectedIndex;<br>    drawDonenessCard(x, y, cardW, 220, i, selected);<br>  }<br><br>  const chosen = DONENESS[selectedIndex];<br>  fill(245, 232, 214);<br>  textSize(20);<br>  text(<br>    chosen.label + &quot;  ·  &quot; + formatDuration(sideDuration()) + &quot; per side&quot;,<br>    width / 2,<br>    height - 80<br>  );<br>}<br><br>function drawDonenessCard(x, y, w, h, index, selected) {<br>  push();<br>  if (selected) {<br>    fill(92, 28, 24);<br>    stroke(220, 70, 58);<br>    strokeWeight(3);<br>  } else {<br>    fill(42, 32, 26);<br>    noStroke();<br>  }<br>  rect(x, y, w, h, 16);<br><br>  drawSteak(x + w / 2, y + 78, w * 0.72, 54, index, true);<br><br>  noStroke();<br>  fill(selected ? 245 : 210, selected ? 232 : 200, selected ? 214 : 176);<br>  textAlign(CENTER, TOP);<br>  textSize(14);<br>  text(DONENESS[index].label, x + w / 2, y + h - 52);<br>  textSize(12);<br>  fill(180, 150, 120);<br>  text(formatDuration(demoMode ? DONENESS[index].demo : DONENESS[index].cook), x + w / 2, y + h - 32);<br>  pop();<br>}<br><br>function drawPrep() {<br>  const step = PREP[prepIndex];<br>  noStroke();<br>  fill(245, 232, 214);<br>  textAlign(CENTER, TOP);<br>  textSize(16);<br>  fill(180, 150, 120);<br>  text(<br>    DONENESS[selectedIndex].label + &quot;  ·  step &quot; + (prepIndex + 1) + &quot; of &quot; + PREP.length,<br>    width / 2,<br>    70<br>  );<br>  fill(245, 232, 214);<br>  textSize(40);<br>  text(step.title, width / 2, 100);<br>  textSize(18);<br>  fill(214, 186, 150);<br>  text(step.copy, width / 2, 152);<br><br>  push();<br>  translate(width / 2, height / 2 + 30);<br>  if (step.id === &quot;season&quot;) {<br>    drawSeasonScene();<br>  } else if (step.id === &quot;pan&quot;) {<br>    drawPanScene(false, false);<br>  } else if (step.id === &quot;oil&quot;) {<br>    drawPanScene(true, false);<br>  } else {<br>    drawPanScene(true, true);<br>  }<br>  pop();<br><br>  noStroke();<br>  fill(220, 70, 58);<br>  textAlign(CENTER, BOTTOM);<br>  textSize(16);<br>  text(&quot;Press the FSR to continue&quot;, width / 2, height - 48);<br>}<br><br>function drawTimerScreen() {<br>  const sideLabel = screen === &quot;sideA&quot; ? &quot;Side A&quot; : &quot;Side B&quot;;<br>  const remaining = remainingMs();<br>  const progress = timerDuration === 0 ? 1 : 1 - remaining / timerDuration;<br><br>  noStroke();<br>  fill(180, 150, 120);<br>  textAlign(CENTER, TOP);<br>  textSize(16);<br>  text(DONENESS[selectedIndex].label + &quot;  ·  &quot; + sideLabel, width / 2, 70);<br><br>  fill(245, 232, 214);<br>  textSize(64);<br>  text(formatMs(remaining), width / 2, 100);<br><br>  push();<br>  translate(width / 2, height / 2 + 40);<br>  noFill();<br>  stroke(60, 46, 38);<br>  strokeWeight(18);<br>  ellipse(0, 0, 280, 280);<br>  stroke(220, 70, 58);<br>  strokeCap(ROUND);<br>  arc(0, 0, 280, 280, -HALF_PI, -HALF_PI + progress * TWO_PI);<br>  drawSteak(0, 0, 150, 78, selectedIndex, true);<br>  pop();<br><br>  noStroke();<br>  fill(214, 186, 150);<br>  textAlign(CENTER, BOTTOM);<br>  textSize(18);<br>  if (timerFinished) {<br>    fill(220, 70, 58);<br>    text(<br>      screen === &quot;sideA&quot;<br>        ? &quot;Flip it. Press the FSR for Side B.&quot;<br>        : &quot;Plate it. Press the FSR to start the rest timer.&quot;,<br>      width / 2,<br>      height - 48<br>    );<br>  } else {<br>    text(&quot;LED on  ·  keep it searing&quot;, width / 2, height - 48);<br>  }<br>}<br><br>function drawRestScreen() {<br>  const remaining = remainingMs();<br>  const progress = timerDuration === 0 ? 1 : 1 - remaining / timerDuration;<br><br>  noStroke();<br>  fill(180, 150, 120);<br>  textAlign(CENTER, TOP);<br>  textSize(16);<br>  text(DONENESS[selectedIndex].label + &quot;  ·  Rest &amp; plate&quot;, width / 2, 70);<br><br>  fill(245, 232, 214);<br>  textSize(64);<br>  text(formatMs(remaining), width / 2, 100);<br>  textSize(18);<br>  fill(214, 186, 150);<br>  text(&quot;Let the juices settle. Don&#39;t cut yet.&quot;, width / 2, 176);<br><br>  push();<br>  translate(width / 2, height / 2 + 50);<br>  noFill();<br>  stroke(60, 46, 38);<br>  strokeWeight(18);<br>  ellipse(0, 0, 300, 300);<br>  stroke(220, 70, 58);<br>  strokeCap(ROUND);<br>  arc(0, 0, 300, 300, -HALF_PI, -HALF_PI + progress * TWO_PI);<br>  fill(48, 38, 32);<br>  noStroke();<br>  ellipse(0, 38, 200, 36);<br>  fill(70, 52, 42);<br>  ellipse(0, 28, 170, 22);<br>  drawSteak(0, -6, 150, 78, selectedIndex, true);<br>  pop();<br><br>  noStroke();<br>  textAlign(CENTER, BOTTOM);<br>  textSize(18);<br>  if (timerFinished) {<br>    fill(220, 70, 58);<br>    text(&quot;Ready to eat. Press the FSR for another steak.&quot;, width / 2, height - 48);<br>  } else {<br>    fill(214, 186, 150);<br>    text(&quot;LED on  ·  resting&quot;, width / 2, height - 48);<br>  }<br>}<br><br>function drawSeasonScene() {<br>  drawSteak(0, 20, 220, 100, selectedIndex, false);<br>  noStroke();<br>  fill(255, 250, 240);<br>  for (let i = 0; i &lt; 28; i++) {<br>    const sx = (i * 47) % 180 - 90;<br>    const sy = ((i * 31) % 70) - 20;<br>    ellipse(sx, sy, 4, 4);<br>  }<br>  fill(214, 186, 150);<br>  textAlign(CENTER, CENTER);<br>  textSize(14);<br>  text(&quot;salt&quot;, 0, 90);<br>}<br><br>function drawPanScene(hasOil, hot) {<br>  fill(36, 30, 26);<br>  ellipse(0, 36, 280, 48);<br>  fill(24, 20, 18);<br>  ellipse(0, 8, 240, 120);<br>  fill(48, 40, 34);<br>  ellipse(0, 8, 200, 96);<br><br>  if (hasOil) {<br>    fill(210, 160, 40, hot ? 220 : 160);<br>    ellipse(0, 12, 150, 58);<br>  }<br><br>  if (hot) {<br>    noFill();<br>    stroke(220, 90, 50, 120);<br>    strokeWeight(2);<br>    for (let i = 0; i &lt; 5; i++) {<br>      const x = -60 + i * 30;<br>      const wobble = sin(millis() / 180 + i) * 6;<br>      bezier(x, -40, x + wobble, -70, x - wobble, -95, x + wobble * 0.3, -120);<br>    }<br>  }<br>}<br><br>function drawSteak(x, y, w, h, index, seared) {<br>  const interior = steakColor(index);<br>  push();<br>  translate(x, y);<br>  noStroke();<br>  if (seared) {<br>    fill(48, 28, 20);<br>  } else {<br>    fill(interior);<br>  }<br>  ellipse(0, 0, w, h);<br>  fill(interior);<br>  ellipse(0, 0, w * 0.78, h * 0.62);<br>  fill(red(interior) - 20, green(interior) - 16, blue(interior) - 10, 180);<br>  ellipse(-w * 0.12, -h * 0.08, w * 0.28, h * 0.22);<br>  pop();<br>}<br><br>function steakColor(index) {<br>  const t = index / (DONENESS.length - 1);<br>  return lerpColor(color(176, 42, 42), color(78, 42, 24), t);<br>}<br><br>function formatDuration(ms) {<br>  const totalSec = round(ms / 1000);<br>  if (totalSec &lt; 60) {<br>    return totalSec + &quot;s&quot;;<br>  }<br>  const m = floor(totalSec / 60);<br>  const s = totalSec % 60;<br>  return s === 0 ? m + &quot; min&quot; : m + &quot;m &quot; + s + &quot;s&quot;;<br>}<br><br>function formatMs(ms) {<br>  const totalSec = ceil(ms / 1000);<br>  const m = floor(totalSec / 60);<br>  const s = totalSec % 60;<br>  return nf(m, 1) + &quot;:&quot; + nf(s, 2);<br>}</pre><p><strong>Schematic</strong></p><p>I used <a href="https://www.tinkercad.com/">Tinkercad</a> for this!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GSR0rBgCc-FXdHTLwUyfDw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=481c5b8c771d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Post-human Design | I am an ant.]]></title>
            <link>https://medium.com/@cheska.p/post-human-design-i-am-an-ant-9c7fedb37f54?source=rss-1599a0efe8e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c7fedb37f54</guid>
            <dc:creator><![CDATA[Cheska P]]></dc:creator>
            <pubDate>Wed, 07 Oct 2026 17:03:27 GMT</pubDate>
            <atom:updated>2026-10-07T17:24:32.327Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Members:</strong> Jerry, Cheska, Lady, Qazybek</p><p>For this workshop we had to select a non-human entity and act as them around the environment. We went to Strawberry Creek and explored around the Faculty Glade. Our group chose ants.</p><h4><strong>Step 1: Observation</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-85mB5Y0Xu5ZUuCc-8CzaQ.png" /><figcaption><em>The larger environment that we noticed as humans.</em></figcaption></figure><p>We watched them move around a wooden rail and through very small spaces. From our view, there were trees, a creek, sunlight, and a lot of scenery around us. An ant may not experience the place as a landscape. Their paths were hard for us to see. They seemed to use edges, cracks, and gaps that we normally ignore. It may mainly respond to the surface, food, smell, contact, and nearby danger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*kFQWu5xGTumdi7mW4d1NEg.png" /><figcaption><em>Two ants interacting with each other through touch and vibrations we cannot feel.</em></figcaption></figure><p>When we tried to imagine being an ant, the place felt very different. As humans, we noticed the trees, the creek, the sunlight, and the larger landscape. As an ant, we imagined paying more attention to the surface, food, smell, chemical trails, and things very close to me.</p><p>We also saw spider webs around the wooden structure. To us, they were small and easy to avoid. To an ant, they could be serious traps. A small hole in the wood could also be much more important at that scale. It could be part of a path or a place to hide.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oy8KrPk8xcLcClT_ZiuZWQ.png" /><figcaption><em>Spider webs around the wooden rail. At an ant scale, these could become major obstacles or traps.</em></figcaption></figure><p><strong>Step 2: Being the Ant</strong></p><p>Each member had to be like the ant for two minutes. We had guide questions that helped us filter out our thoughts regarding being an ant.</p><ul><li>What do you feel as the ant?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x9WYMvjxfhl5B0R7eTkMyg.png" /></figure><ul><li>What is your sense of time as an ant?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X8SQa2G4U70YXYNswEkN_A.png" /></figure><ul><li>What is your mobility like as the ant?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UDYfF_IRdl4cSnWHgTS0jA.png" /></figure><ul><li>How do you describe your relationship with humans?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HFigoCGrPFrRBi2Kby9zIA.png" /></figure><ul><li>How do you describe your relationship with other non-humans?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vuLXsQPr_iSj3WrmzN2x9A.png" /></figure><p><strong>Surprises and discoveries. </strong>The same place can feel completely different at another scale. A tiny gap that means almost nothing to us can be an important path for an ant.</p><p><strong>Empathy for non humans. </strong>We realized that small human actions can change an ant path or shelter without us noticing.</p><p><strong>Using more senses. </strong>We paid more attention to smell, touch, surface, small movement, and the spaces between objects.</p><p><strong>New respect for non-humans. </strong>Ants are small, but they move through a detailed world that people usually do not notice.</p><p><strong>What does it mean to decenter humans? </strong>It means not treating the human view as the only useful view. The same place can mean something very different to another living thing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vSS4UiojHWTRdyqouQBuwQ.png" /><figcaption><em>(Left image) A larger animal was easy for us to notice, while ants and their paths were much easier to miss. (Right image) Small gaps, edges, and surfaces that are easy for people to ignore.</em></figcaption></figure><p><strong>Technologies that center non humans. </strong>Wildlife cameras, animal tracking tags, and environmental sensors can help us notice animal behavior and conditions that people may miss.</p><p><strong>What is post human design? </strong>Post human design asks us to think about humans, other living things, and the environment together. We cannot fully know what an ant feels, but we can pay more attention to a world that is easy for us to overlook.</p><h4>Takeaway</h4><p>This activity made us notice how much of the environment we do not use and see we usually ignore. For us, decentering humans means remembering that the same place can be used and experienced in very different ways. Post-human design gives us a reason to pay attention to those other relationships.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c7fedb37f54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Steak Timer | Lab 5: Piezo Speakers]]></title>
            <link>https://medium.com/@cheska.p/steak-timer-lab-5-piezo-speakers-7a0db660dddf?source=rss-1599a0efe8e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a0db660dddf</guid>
            <dc:creator><![CDATA[Cheska P]]></dc:creator>
            <pubDate>Mon, 05 Oct 2026 18:37:59 GMT</pubDate>
            <atom:updated>2026-10-05T18:37:59.618Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GJdr9h18bRdCdPSMYZZLHg.png" /></figure><p>The goal of this lab was to work with piezo speakers and create an interaction using multiple inputs and outputs. For my inputs, I used a potentiometer and an FSR. For my outputs, I used a red LED and a piezo speaker.</p><p>I decided to make a steak timer because I rarely cook steak. Since I don’t make it often, I can never remember what worked for me the last time. I usually end up searching online for how long to cook each side based on the doneness I want. My preference also changes depending on my mood, so I wanted to keep the different options and cooking steps together in one place.</p><p>The timer starts with a menu showing five levels of doneness: rare, medium-rare, medium, medium-well, and well-done. I use the potentiometer to move between them. Turning the potentiometer changes which option is highlighted on the screen. Once I reach the doneness I want, I press the FSR to select it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DWaWmM1lYy7xInMyOYPSkA.png" /></figure><p>I also wanted the project to include more than just the timers. I still have to look up or remember everything that happens before putting the steak in the pan, so the interface walks through a few basic steps: season the steak, get the pan, add oil, and heat the pan. The FSR acts like a next button here. Each press moves the instructions to the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pJOEE0xCg608abhm6JUOeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*edorzIUzkzxqf8hIoG12aw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Eg9ZuaWAwyzTi0Ef99Cm5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eBMo-dAvQKiF3R6SpPfT8A.png" /></figure><p>After the preparation steps, the first timer begins for Side A. The amount of time depends on the doneness selected at the beginning. When the timer starts, the red LED turns on.</p><p>I chose the LED as a visual reminder that the steak is currently cooking because I tend to get distracted and forget that I have something in the pan. As long as the timer is running, the light stays on. This gives me something physical to glance at even if I am not looking directly at the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dj4aCzeljF760tp21MqkyQ.png" /></figure><p>When the Side A timer finishes, the LED starts blinking and the piezo speaker plays a short sound. I wanted the alert to be more fun than a regular timer beep, so I made it sound a little like something from Cooking Mama. The sound tells me that it is time to return to the stove, while the blinking LED provides the same message visually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2gAE80B2HhYVameR2tQsLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8elA0V35e0i65A9aSbbZvA.png" /></figure><p>After flipping the steak, I press the FSR again to begin the timer for Side B. The LED returns to a solid light while the timer is running. Once Side B is finished, the LED blinks and the piezo plays the sound again.</p><p>At first, I thought the process would end after cooking both sides. However, steak is also supposed to rest before it is cut. This is another step that I tend to forget, so I added a separate rest timer. After Side B, I would have to place the steak on a plate and press the FSR to start resting it. The LED shows that the process is still going, and the piezo lets me know when the steak is finally ready to eat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D9CQfOJX2lzF0nJipzgxsw.png" /></figure><p>The final interaction became:</p><p>potentiometer to choose the doneness → FSR to select → FSR to move through the preparation steps → LED to show that a timer is active → blinking LED and piezo sound when the timer is complete</p><p>I liked that each component had its own role. The potentiometer works well for navigating through a range of choices, while the FSR works more like a physical confirmation button. The LED gives me a reminder from across the room, and the piezo gives me a more noticeable signal when I need to do something.</p><p><strong>Video</strong></p><p>Here’s the steak timer in action! Hopefully, the next time I decide to make steak, I won’t have to figure everything out again. The timer is shorter for demo purposes.</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNSzuRBHwqD8&amp;type=text%2Fhtml&amp;schema=youtube&amp;display_name=YouTube&amp;src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FNSzuRBHwqD8%3Ffeature%3Doembed" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/70e41fab1b7c1bb48e245bdaf0e7e5fb/href">https://medium.com/media/70e41fab1b7c1bb48e245bdaf0e7e5fb/href</a></iframe><p><strong>Code</strong></p><p>I let AI do the coding for me! I’ve been trying to integrate AI in my workflows more (ofc, I make sure I can do it without but I’ve been learning to be more efficient by offloading some work once I am confident I can do it without!)</p><p>Here’s the Arduino Code</p><pre>const int FSR_PIN = A0;<br>const int POT_PIN = A1;<br>const int LED_PIN = 9;<br>const int PIEZO_PIN = 8;<br><br>enum LedMode { LED_OFF, LED_ON, LED_BLINK };<br>LedMode ledMode = LED_OFF;<br><br>unsigned long lastPrint = 0;<br>unsigned long lastBlink = 0;<br>bool blinkOn = false;<br><br>String incoming = &quot;&quot;;<br><br>void setup() {<br>  Serial.begin(9600);<br>  pinMode(LED_PIN, OUTPUT);<br>  pinMode(PIEZO_PIN, OUTPUT);<br>  digitalWrite(LED_PIN, LOW);<br>}<br><br>void loop() {<br>  while (Serial.available() &gt; 0) {<br>    char c = (char)Serial.read();<br>    if (c == &#39;\n&#39; || c == &#39;\r&#39;) {<br>      if (incoming.length() &gt; 0) {<br>        handleCommand(incoming);<br>        incoming = &quot;&quot;;<br>      }<br>    } else {<br>      incoming += c;<br>      if (incoming.length() &gt; 64) {<br>        incoming = &quot;&quot;;<br>      }<br>    }<br>  }<br><br>  unsigned long now = millis();<br><br>  if (ledMode == LED_OFF) {<br>    digitalWrite(LED_PIN, LOW);<br>  } else if (ledMode == LED_ON) {<br>    digitalWrite(LED_PIN, HIGH);<br>  } else if (now - lastBlink &gt;= 400) {<br>    lastBlink = now;<br>    blinkOn = !blinkOn;<br>    digitalWrite(LED_PIN, blinkOn ? HIGH : LOW);<br>  }<br><br>  if (now - lastPrint &gt;= 40) {<br>    lastPrint = now;<br>    Serial.print(&quot;fsr: &quot;);<br>    Serial.println(analogRead(FSR_PIN));<br>    Serial.print(&quot;potentiometer: &quot;);<br>    Serial.println(analogRead(POT_PIN));<br>  }<br>}<br><br>void handleCommand(String line) {<br>  line.trim();<br>  int colon = line.indexOf(&#39;:&#39;);<br>  if (colon &lt; 0) {<br>    return;<br>  }<br><br>  String name = line.substring(0, colon);<br>  String value = line.substring(colon + 1);<br>  name.trim();<br>  value.trim();<br>  name.toLowerCase();<br>  value.toLowerCase();<br><br>  if (name == &quot;led&quot;) {<br>    if (value == &quot;off&quot;) {<br>      ledMode = LED_OFF;<br>    } else if (value == &quot;on&quot;) {<br>      ledMode = LED_ON;<br>    } else if (value == &quot;blink&quot;) {<br>      ledMode = LED_BLINK;<br>      lastBlink = 0;<br>      blinkOn = true;<br>    }<br>  } else if (name == &quot;piezo&quot; &amp;&amp; value == &quot;done&quot;) {<br>    playDoneMelody();<br>  }<br>}<br><br>void playDoneMelody() {<br>  // Cooking Mama-style title motif (E G A G E D E ...)<br>  const int notes[] = {659, 784, 880, 784, 659, 587, 659, 784, 880, 988, 880, 784, 659};<br>  const int durs[] = {140, 140, 280, 140, 140, 280, 140, 140, 280, 280, 140, 140, 420};<br>  const int count = 13;<br>  for (int i = 0; i &lt; count; i++) {<br>    tone(PIEZO_PIN, notes[i], durs[i]);<br>    delay(durs[i] + 30);<br>  }<br>  noTone(PIEZO_PIN);<br>}</pre><p>Here’re are the p5.js components</p><p>index.html</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>  &lt;head&gt;<br>    &lt;script src=&quot;https://cdn.jsdelivr.net/npm/p5@1.11.10/lib/p5.js&quot;&gt;&lt;/script&gt;<br>    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot; /&gt;<br>    &lt;meta charset=&quot;utf-8&quot; /&gt;<br>    &lt;title&gt;Steak Timer&lt;/title&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;main&gt;&lt;/main&gt;<br>    &lt;script src=&quot;sketch.js&quot;&gt;&lt;/script&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><p>style.css</p><pre>html,<br>body {<br>  margin: 0;<br>  padding: 0;<br>  overflow: hidden;<br>  background: #1c1612;<br>}<br><br>canvas {<br>  display: block;<br>}</pre><p>sketch.js</p><pre>const FSR_THRESHOLD = 400;<br>const BAUD_RATE = 9600;<br><br>const DONENESS = [  { id: &quot;rare&quot;, label: &quot;Rare&quot;, cook: 2.5 * 60 * 1000, demo: 6000 },  { id: &quot;medium-rare&quot;, label: &quot;Medium-rare&quot;, cook: 3.5 * 60 * 1000, demo: 8000 },  { id: &quot;medium&quot;, label: &quot;Medium&quot;, cook: 4.5 * 60 * 1000, demo: 10000 },  { id: &quot;medium-well&quot;, label: &quot;Medium-well&quot;, cook: 5.5 * 60 * 1000, demo: 12000 },  { id: &quot;well&quot;, label: &quot;Well-done&quot;, cook: 6.5 * 60 * 1000, demo: 14000 },];<br><br>const REST = { cook: 5 * 60 * 1000, demo: 8000 };<br><br>const PREP = [  {    id: &quot;season&quot;,    title: &quot;Season it&quot;,    copy: &quot;Pat dry, then salt both sides generously.&quot;,  },  {    id: &quot;pan&quot;,    title: &quot;Grab a pan&quot;,    copy: &quot;Use a heavy skillet. Cast iron is ideal.&quot;,  },  {    id: &quot;oil&quot;,    title: &quot;Add oil&quot;,    copy: &quot;A thin coat of high-heat oil. Just enough to shimmer.&quot;,  },  {    id: &quot;heat&quot;,    title: &quot;Heat it up&quot;,    copy: &quot;Wait until the pan is ripping hot, then lay the steak down.&quot;,  },];<br><br>let serialStatus = &quot;disconnected&quot;;<br>let serialWriter = null;<br>let serialBuffer = &quot;&quot;;<br>let lastSerialLine = &quot;&quot;;<br><br>let sensors = { fsr: 0, potentiometer: 512 };<br>let fsrWasDown = false;<br>let keyboardFsrPulse = false;<br><br>let demoMode = true;<br>let screen = &quot;select&quot;;<br>let selectedIndex = 2;<br>let prepIndex = 0;<br><br>let timerStartedAt = 0;<br>let timerDuration = 0;<br>let timerFinished = false;<br>let timerAlerted = false;<br>let currentLed = &quot;&quot;;<br><br>function setup() {<br>  createCanvas(windowWidth, windowHeight);<br>  textFont(&quot;Georgia&quot;);<br><br>  const connectButton = createButton(&quot;Connect to Arduino&quot;);<br>  connectButton.position(12, 12);<br>  connectButton.mousePressed(initSerial);<br>}<br><br>function windowResized() {<br>  resizeCanvas(windowWidth, windowHeight);<br>}<br><br>async function initSerial() {<br>  if (!navigator.serial) {<br>    serialStatus = &quot;error: Web Serial needs Chrome or Edge&quot;;<br>    return;<br>  }<br><br>  try {<br>    const port = await navigator.serial.requestPort();<br>    await port.open({ baudRate: BAUD_RATE });<br>    serialStatus = &quot;connected&quot;;<br><br>    const encoder = new TextEncoderStream();<br>    encoder.readable.pipeTo(port.writable);<br>    serialWriter = encoder.writable.getWriter();<br><br>    const decoder = new TextDecoderStream();<br>    port.readable.pipeTo(decoder.writable);<br>    const reader = decoder.readable.getReader();<br><br>    function scheduleRead() {<br>      reader.read().then(({ value, done }) =&gt; {<br>        if (done) {<br>          serialStatus = &quot;disconnected&quot;;<br>          serialWriter = null;<br>          return;<br>        }<br>        if (value) {<br>          ingestSerialChunk(value);<br>        }<br>        scheduleRead();<br>      });<br>    }<br>    scheduleRead();<br>  } catch (err) {<br>    serialStatus = &quot;error: &quot; + err.message;<br>  }<br>}<br><br>function ingestSerialChunk(chunk) {<br>  serialBuffer += chunk.replace(/\r/g, &quot;&quot;);<br>  let newline = serialBuffer.indexOf(&quot;\n&quot;);<br>  while (newline &gt;= 0) {<br>    const line = serialBuffer.slice(0, newline).trim();<br>    serialBuffer = serialBuffer.slice(newline + 1);<br>    if (line) {<br>      handleSerialLine(line);<br>    }<br>    newline = serialBuffer.indexOf(&quot;\n&quot;);<br>  }<br>}<br><br>function handleSerialLine(line) {<br>  lastSerialLine = line;<br>  const colon = line.indexOf(&quot;:&quot;);<br>  if (colon &lt; 0) {<br>    return;<br>  }<br>  const name = line.slice(0, colon).trim().toLowerCase();<br>  const value = Number(line.slice(colon + 1).trim());<br>  if (Number.isNaN(value)) {<br>    return;<br>  }<br>  if (name === &quot;fsr&quot;) {<br>    sensors.fsr = value;<br>  } else if (name === &quot;potentiometer&quot;) {<br>    sensors.potentiometer = value;<br>  }<br>}<br><br>function sendCommand(line) {<br>  if (!serialWriter) {<br>    return;<br>  }<br>  serialWriter.write(line + &quot;\n&quot;).catch((err) =&gt; {<br>    serialStatus = &quot;error: &quot; + err.message;<br>  });<br>}<br><br>function setLed(mode) {<br>  if (currentLed === mode) {<br>    return;<br>  }<br>  currentLed = mode;<br>  sendCommand(&quot;led: &quot; + mode);<br>}<br><br>function draw() {<br>  background(28, 22, 18);<br>  updateInputs();<br><br>  if (screen === &quot;select&quot;) {<br>    drawSelect();<br>  } else if (screen === &quot;prep&quot;) {<br>    drawPrep();<br>  } else if (screen === &quot;sideA&quot; || screen === &quot;sideB&quot;) {<br>    drawTimerScreen();<br>  } else {<br>    drawRestScreen();<br>  }<br><br>  drawHud();<br>}<br><br>function updateInputs() {<br>  if (screen === &quot;select&quot;) {<br>    const pot = constrain(sensors.potentiometer, 0, 1023);<br>    selectedIndex = constrain(floor(map(pot, 0, 1024, 0, DONENESS.length)), 0, DONENESS.length - 1);<br>  }<br><br>  if (isTimerScreen()) {<br>    updateTimer();<br>  }<br><br>  const fsrDown = sensors.fsr &gt;= FSR_THRESHOLD;<br>  const fsrPressed = (!fsrWasDown &amp;&amp; fsrDown) || keyboardFsrPulse;<br>  fsrWasDown = fsrDown;<br>  keyboardFsrPulse = false;<br>  if (fsrPressed) {<br>    onConfirm();<br>  }<br>}<br><br>function onConfirm() {<br>  if (screen === &quot;select&quot;) {<br>    prepIndex = 0;<br>    screen = &quot;prep&quot;;<br>    setLed(&quot;off&quot;);<br>    return;<br>  }<br><br>  if (screen === &quot;prep&quot;) {<br>    if (prepIndex &lt; PREP.length - 1) {<br>      prepIndex += 1;<br>    } else {<br>      startSide(&quot;sideA&quot;);<br>    }<br>    return;<br>  }<br><br>  if (screen === &quot;sideA&quot;) {<br>    if (timerFinished) {<br>      startSide(&quot;sideB&quot;);<br>    }<br>    return;<br>  }<br><br>  if (screen === &quot;sideB&quot;) {<br>    if (timerFinished) {<br>      startTimer(&quot;done&quot;, restDuration());<br>    }<br>    return;<br>  }<br><br>  if (screen === &quot;done&quot;) {<br>    if (timerFinished) {<br>      screen = &quot;select&quot;;<br>      setLed(&quot;off&quot;);<br>    }<br>  }<br>}<br><br>function isTimerScreen() {<br>  return screen === &quot;sideA&quot; || screen === &quot;sideB&quot; || screen === &quot;done&quot;;<br>}<br><br>function startSide(nextScreen) {<br>  startTimer(nextScreen, sideDuration());<br>}<br><br>function startTimer(nextScreen, duration) {<br>  screen = nextScreen;<br>  timerDuration = duration;<br>  timerStartedAt = millis();<br>  timerFinished = false;<br>  timerAlerted = false;<br>  setLed(&quot;on&quot;);<br>}<br><br>function sideDuration() {<br>  const level = DONENESS[selectedIndex];<br>  return demoMode ? level.demo : level.cook;<br>}<br><br>function restDuration() {<br>  return demoMode ? REST.demo : REST.cook;<br>}<br><br>function activeDuration() {<br>  return screen === &quot;done&quot; ? restDuration() : sideDuration();<br>}<br><br>function updateTimer() {<br>  const remaining = timerDuration - (millis() - timerStartedAt);<br>  if (remaining &gt; 0) {<br>    return;<br>  }<br>  timerFinished = true;<br>  if (!timerAlerted) {<br>    timerAlerted = true;<br>    setLed(&quot;blink&quot;);<br>    sendCommand(&quot;piezo: done&quot;);<br>  }<br>}<br><br>function remainingMs() {<br>  return max(0, timerDuration - (millis() - timerStartedAt));<br>}<br><br>function keyPressed() {<br>  if (key === &quot; &quot; || keyCode === ENTER) {<br>    keyboardFsrPulse = true;<br>    return false;<br>  }<br>  if (key === &quot;d&quot; || key === &quot;D&quot;) {<br>    demoMode = !demoMode;<br>    if (isTimerScreen()) {<br>      const elapsed = millis() - timerStartedAt;<br>      const progress = timerDuration === 0 ? 0 : elapsed / timerDuration;<br>      timerDuration = activeDuration();<br>      timerStartedAt = millis() - progress * timerDuration;<br>      if (!timerFinished &amp;&amp; remainingMs() &lt;= 0) {<br>        timerFinished = true;<br>      }<br>    }<br>    return;<br>  }<br>  const num = int(key);<br>  if (num &gt;= 1 &amp;&amp; num &lt;= 5) {<br>    sensors.potentiometer = map(num - 1, 0, DONENESS.length - 1, 80, 940);<br>  }<br>}<br><br>function drawHud() {<br>  noStroke();<br>  fill(214, 186, 150);<br>  textAlign(LEFT, TOP);<br>  textSize(13);<br>  textFont(&quot;Helvetica&quot;);<br>  const modeLabel = demoMode ? &quot;DEMO times&quot; : &quot;COOK times&quot;;<br>  const line2 = lastSerialLine ? &quot;  ·  &quot; + lastSerialLine : &quot;&quot;;<br>  text(serialStatus + line2, 12, 48);<br>  text(modeLabel + &quot;  ·  D toggles  ·  Space = FSR  ·  1–5 doneness&quot;, 12, height - 36);<br>  textFont(&quot;Georgia&quot;);<br>}<br><br>function drawSelect() {<br>  noStroke();<br>  fill(245, 232, 214);<br>  textAlign(CENTER, TOP);<br>  textSize(42);<br>  text(&quot;Steak Timer&quot;, width / 2, 72);<br>  textSize(18);<br>  fill(214, 186, 150);<br>  text(&quot;Turn the potentiometer. Press the FSR to choose.&quot;, width / 2, 124);<br><br>  const cardW = min(160, (width - 120) / DONENESS.length);<br>  const gap = 18;<br>  const totalW = DONENESS.length * cardW + (DONENESS.length - 1) * gap;<br>  const startX = (width - totalW) / 2;<br>  const y = height / 2 - 20;<br><br>  for (let i = 0; i &lt; DONENESS.length; i++) {<br>    const x = startX + i * (cardW + gap);<br>    const selected = i === selectedIndex;<br>    drawDonenessCard(x, y, cardW, 220, i, selected);<br>  }<br><br>  const chosen = DONENESS[selectedIndex];<br>  fill(245, 232, 214);<br>  textSize(20);<br>  text(<br>    chosen.label + &quot;  ·  &quot; + formatDuration(sideDuration()) + &quot; per side&quot;,<br>    width / 2,<br>    height - 80<br>  );<br>}<br><br>function drawDonenessCard(x, y, w, h, index, selected) {<br>  push();<br>  if (selected) {<br>    fill(92, 28, 24);<br>    stroke(220, 70, 58);<br>    strokeWeight(3);<br>  } else {<br>    fill(42, 32, 26);<br>    noStroke();<br>  }<br>  rect(x, y, w, h, 16);<br><br>  drawSteak(x + w / 2, y + 78, w * 0.72, 54, index, true);<br><br>  noStroke();<br>  fill(selected ? 245 : 210, selected ? 232 : 200, selected ? 214 : 176);<br>  textAlign(CENTER, TOP);<br>  textSize(14);<br>  text(DONENESS[index].label, x + w / 2, y + h - 52);<br>  textSize(12);<br>  fill(180, 150, 120);<br>  text(formatDuration(demoMode ? DONENESS[index].demo : DONENESS[index].cook), x + w / 2, y + h - 32);<br>  pop();<br>}<br><br>function drawPrep() {<br>  const step = PREP[prepIndex];<br>  noStroke();<br>  fill(245, 232, 214);<br>  textAlign(CENTER, TOP);<br>  textSize(16);<br>  fill(180, 150, 120);<br>  text(<br>    DONENESS[selectedIndex].label + &quot;  ·  step &quot; + (prepIndex + 1) + &quot; of &quot; + PREP.length,<br>    width / 2,<br>    70<br>  );<br>  fill(245, 232, 214);<br>  textSize(40);<br>  text(step.title, width / 2, 100);<br>  textSize(18);<br>  fill(214, 186, 150);<br>  text(step.copy, width / 2, 152);<br><br>  push();<br>  translate(width / 2, height / 2 + 30);<br>  if (step.id === &quot;season&quot;) {<br>    drawSeasonScene();<br>  } else if (step.id === &quot;pan&quot;) {<br>    drawPanScene(false, false);<br>  } else if (step.id === &quot;oil&quot;) {<br>    drawPanScene(true, false);<br>  } else {<br>    drawPanScene(true, true);<br>  }<br>  pop();<br><br>  noStroke();<br>  fill(220, 70, 58);<br>  textAlign(CENTER, BOTTOM);<br>  textSize(16);<br>  text(&quot;Press the FSR to continue&quot;, width / 2, height - 48);<br>}<br><br>function drawTimerScreen() {<br>  const sideLabel = screen === &quot;sideA&quot; ? &quot;Side A&quot; : &quot;Side B&quot;;<br>  const remaining = remainingMs();<br>  const progress = timerDuration === 0 ? 1 : 1 - remaining / timerDuration;<br><br>  noStroke();<br>  fill(180, 150, 120);<br>  textAlign(CENTER, TOP);<br>  textSize(16);<br>  text(DONENESS[selectedIndex].label + &quot;  ·  &quot; + sideLabel, width / 2, 70);<br><br>  fill(245, 232, 214);<br>  textSize(64);<br>  text(formatMs(remaining), width / 2, 100);<br><br>  push();<br>  translate(width / 2, height / 2 + 40);<br>  noFill();<br>  stroke(60, 46, 38);<br>  strokeWeight(18);<br>  ellipse(0, 0, 280, 280);<br>  stroke(220, 70, 58);<br>  strokeCap(ROUND);<br>  arc(0, 0, 280, 280, -HALF_PI, -HALF_PI + progress * TWO_PI);<br>  drawSteak(0, 0, 150, 78, selectedIndex, true);<br>  pop();<br><br>  noStroke();<br>  fill(214, 186, 150);<br>  textAlign(CENTER, BOTTOM);<br>  textSize(18);<br>  if (timerFinished) {<br>    fill(220, 70, 58);<br>    text(<br>      screen === &quot;sideA&quot;<br>        ? &quot;Flip it. Press the FSR for Side B.&quot;<br>        : &quot;Plate it. Press the FSR to start the rest timer.&quot;,<br>      width / 2,<br>      height - 48<br>    );<br>  } else {<br>    text(&quot;LED on  ·  keep it searing&quot;, width / 2, height - 48);<br>  }<br>}<br><br>function drawRestScreen() {<br>  const remaining = remainingMs();<br>  const progress = timerDuration === 0 ? 1 : 1 - remaining / timerDuration;<br><br>  noStroke();<br>  fill(180, 150, 120);<br>  textAlign(CENTER, TOP);<br>  textSize(16);<br>  text(DONENESS[selectedIndex].label + &quot;  ·  Rest &amp; plate&quot;, width / 2, 70);<br><br>  fill(245, 232, 214);<br>  textSize(64);<br>  text(formatMs(remaining), width / 2, 100);<br>  textSize(18);<br>  fill(214, 186, 150);<br>  text(&quot;Let the juices settle. Don&#39;t cut yet.&quot;, width / 2, 176);<br><br>  push();<br>  translate(width / 2, height / 2 + 50);<br>  noFill();<br>  stroke(60, 46, 38);<br>  strokeWeight(18);<br>  ellipse(0, 0, 300, 300);<br>  stroke(220, 70, 58);<br>  strokeCap(ROUND);<br>  arc(0, 0, 300, 300, -HALF_PI, -HALF_PI + progress * TWO_PI);<br>  fill(48, 38, 32);<br>  noStroke();<br>  ellipse(0, 38, 200, 36);<br>  fill(70, 52, 42);<br>  ellipse(0, 28, 170, 22);<br>  drawSteak(0, -6, 150, 78, selectedIndex, true);<br>  pop();<br><br>  noStroke();<br>  textAlign(CENTER, BOTTOM);<br>  textSize(18);<br>  if (timerFinished) {<br>    fill(220, 70, 58);<br>    text(&quot;Ready to eat. Press the FSR for another steak.&quot;, width / 2, height - 48);<br>  } else {<br>    fill(214, 186, 150);<br>    text(&quot;LED on  ·  resting&quot;, width / 2, height - 48);<br>  }<br>}<br><br>function drawSeasonScene() {<br>  drawSteak(0, 20, 220, 100, selectedIndex, false);<br>  noStroke();<br>  fill(255, 250, 240);<br>  for (let i = 0; i &lt; 28; i++) {<br>    const sx = (i * 47) % 180 - 90;<br>    const sy = ((i * 31) % 70) - 20;<br>    ellipse(sx, sy, 4, 4);<br>  }<br>  fill(214, 186, 150);<br>  textAlign(CENTER, CENTER);<br>  textSize(14);<br>  text(&quot;salt&quot;, 0, 90);<br>}<br><br>function drawPanScene(hasOil, hot) {<br>  fill(36, 30, 26);<br>  ellipse(0, 36, 280, 48);<br>  fill(24, 20, 18);<br>  ellipse(0, 8, 240, 120);<br>  fill(48, 40, 34);<br>  ellipse(0, 8, 200, 96);<br><br>  if (hasOil) {<br>    fill(210, 160, 40, hot ? 220 : 160);<br>    ellipse(0, 12, 150, 58);<br>  }<br><br>  if (hot) {<br>    noFill();<br>    stroke(220, 90, 50, 120);<br>    strokeWeight(2);<br>    for (let i = 0; i &lt; 5; i++) {<br>      const x = -60 + i * 30;<br>      const wobble = sin(millis() / 180 + i) * 6;<br>      bezier(x, -40, x + wobble, -70, x - wobble, -95, x + wobble * 0.3, -120);<br>    }<br>  }<br>}<br><br>function drawSteak(x, y, w, h, index, seared) {<br>  const interior = steakColor(index);<br>  push();<br>  translate(x, y);<br>  noStroke();<br>  if (seared) {<br>    fill(48, 28, 20);<br>  } else {<br>    fill(interior);<br>  }<br>  ellipse(0, 0, w, h);<br>  fill(interior);<br>  ellipse(0, 0, w * 0.78, h * 0.62);<br>  fill(red(interior) - 20, green(interior) - 16, blue(interior) - 10, 180);<br>  ellipse(-w * 0.12, -h * 0.08, w * 0.28, h * 0.22);<br>  pop();<br>}<br><br>function steakColor(index) {<br>  const t = index / (DONENESS.length - 1);<br>  return lerpColor(color(176, 42, 42), color(78, 42, 24), t);<br>}<br><br>function formatDuration(ms) {<br>  const totalSec = round(ms / 1000);<br>  if (totalSec &lt; 60) {<br>    return totalSec + &quot;s&quot;;<br>  }<br>  const m = floor(totalSec / 60);<br>  const s = totalSec % 60;<br>  return s === 0 ? m + &quot; min&quot; : m + &quot;m &quot; + s + &quot;s&quot;;<br>}<br><br>function formatMs(ms) {<br>  const totalSec = ceil(ms / 1000);<br>  const m = floor(totalSec / 60);<br>  const s = totalSec % 60;<br>  return nf(m, 1) + &quot;:&quot; + nf(s, 2);<br>}</pre><p><strong>Components</strong></p><ul><li>1 Arduino</li><li>1 LED</li><li>2 220Ω Resistors</li><li>1 1kΩ Resistors</li><li>1 Breadboard</li><li>1 Piezo Buzzer</li><li>1 Potentiometer</li><li>1 Force Sensitive Resistor</li><li>Wires</li><li>USB-C Connector for Arduino</li></ul><p><strong>Schematic</strong></p><p>I used <a href="https://www.tinkercad.com/">Tinkercad</a> for this!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tAuGW4qNfnE5kdCIaaanDg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a0db660dddf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Donut Goes Trick or Treating | Lab 4: Sensing with Force Sensors]]></title>
            <link>https://medium.com/@cheska.p/donut-goes-trick-or-treating-lab-4-sensing-with-force-sensors-6cab32fd9323?source=rss-1599a0efe8e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cab32fd9323</guid>
            <dc:creator><![CDATA[Cheska P]]></dc:creator>
            <pubDate>Mon, 28 Sep 2026 13:20:10 GMT</pubDate>
            <atom:updated>2026-09-28T13:28:47.658Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*hBGS36fH6wBNhVTiWfyqDg.png" /></figure><p>In our most recent lab, we explored two new sensors: force sensitive resistors (FSR) and photocells. For this lab’s homework, we were tasked to create an interesting visualization using the sensor’s input. We also have to mask these sensors in physical objects to make interacting with them intuitive.</p><p>I immediately thought of something like a weighing scale and wanted to play with the FSR to see how much I can push it with the limited tools I had. You can guess from the title of this article that I immediately realized it was not going to happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WQ_Y0SmTK__68zD0L-Ph7w.png" /></figure><p>The plan was to find a small enough item I could use to focus all the weight I would pile into a clear box container onto the FSR. Problem was, it wasn’t stable. Even if the structure became stable, the way the weight would be distributed mattered. I couldn’t do it with what I had so that meant I had to move from a very precise idea → something that isn’t as strict.</p><p>I decided that my idea needed to have at most four states and I was committed to letting the movement of placing objects on top of the FSR as my intuitive interaction. The Walgreens I go to has their Halloween section up. Trick or treating uses a bag and you place items inside. Aha! That’s what I want to do. I don’t have a costume and neither does my sister’s dog (Donut) but she’s cute enough to make you give her candy without dressing up.</p><p><strong>Final idea:</strong> provide area where I can deposit candy → show dog on screen having an increasing/decreasing amount of candy based on the FSR value</p><p>The four states for this are: empty pumpkin, a bit of treats, some more treats, a lot of treats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bj3mvBjraL1Ju3wzoohtQg.png" /></figure><p>The balancing part was the one that took the most time. I had a lot of tape iterations where the angle of the container’s tilt is what dictated how much force was being applied to the FSR. This was also highly unstable. It would work, then it would not. Then it would topple over. I tried adding items below, but the issue was it would not allow the container to dip which affected how much force was being transferred to the FSR. The tape would allow it to dip but it would not go back up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PFHh8qxv0_UN43CQVaRlMA.png" /></figure><p>At some point I knew I would need a spring and I was stubborn with the tape since I did not have the springs I needed. After a while I realized that I had the long wires from my three potentiometers. Lucky for me, these wires were hard enough so that I could coil it around my finger and it would still retain its shape after. The DIY springs helped keep the container stable and allowed it to go back up after dipping.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tl4d4VwSuEpPbmEFQifKzA.png" /></figure><p>I started off with a clear plastic container but it was struggling to focus on that small point. I had to replace it. My rice cooker’s cooking plate happened to be the perfect container (it’s orange too!). I placed some tissue inside the middle portion since it’s too high for the cabinet foot screw to reach. The tissue also helped so that once it initially hits the tissue, it can still push a bit more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hv2CyltLsG58k5myBu8mMA.png" /></figure><p>Here is Donut trick or treating!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F7Mx1Wib7nco%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2F7Mx1Wib7nco&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F7Mx1Wib7nco%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/05c4f6ee5ed5113c55fa6f3902700109/href">https://medium.com/media/05c4f6ee5ed5113c55fa6f3902700109/href</a></iframe><p><strong>Components</strong></p><ul><li>1 Arduino</li><li>1 Resistor (10kΩ)</li><li>1 Breadboard</li><li>Wires</li><li>USB-C Connector for Arduino</li><li>Force Sensitive Resistor</li><li>Cabinet Foot Screw</li><li>Tape</li><li>Rice Cooker Cooking Plate</li><li>Tissue</li></ul><p><strong>Schematic</strong></p><p>I used <a href="https://www.tinkercad.com/">Tinkercad</a> for this!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*ZQhlJe5vG4ul_6yquqwc0w.png" /></figure><p><strong>Code</strong></p><p><em>Arduino</em></p><p>I just used Connie’s provided code.</p><pre>const int potPin = A0;<br><br>int potVal = 0;<br><br>void setup() {<br><br>  pinMode(potPin, INPUT); <br><br>  Serial.begin(9600);<br><br>}<br><br>void loop() {<br><br>   potVal = analogRead(A0);<br><br>  Serial.println(potVal);<br><br>  delay(10);<br><br>}</pre><p><em>p5.js</em></p><p>I just extended Connie’s initial code to include images and simple if statements for the bag states.</p><pre>let latestData = &quot;&quot;;<br>let bagState = &quot;empty&quot;;<br><br>function preload(){ <br>  donut= loadImage(&quot;images/donut-neutral.jpeg&quot;);<br>  bag = {<br>    &quot;empty&quot;: loadImage(&quot;images/bag-empty.png&quot;),<br>    &quot;bit&quot;: loadImage(&quot;images/bag-bit.png&quot;),<br>    &quot;some&quot;: loadImage(&quot;images/bag-some.png&quot;),<br>    &quot;many&quot;: loadImage(&quot;images/bag-many.png&quot;),<br>  }<br>}<br><br>function setup() {<br>  createCanvas(windowWidth, windowHeight);<br><br>  let connectButton = createButton(&quot;Connect to Arduino&quot;);<br>  connectButton.position(10, 10);<br>  connectButton.mousePressed(initSerial);<br>}<br><br>async function initSerial() {<br>  try {<br>    const port = await navigator.serial.requestPort();<br>    await port.open({ baudRate: 9600 });<br>    status = &quot;connected&quot;;<br><br>    const decoder = new TextDecoderStream();<br>    port.readable.pipeTo(decoder.writable);<br>    const reader = decoder.readable.getReader();<br><br>    // Use setTimeout to read outside p5&#39;s loop detection<br>    function scheduleRead() {<br>      reader.read().then(({ value, done }) =&gt; {<br>        if (done) return;<br>        if (value) latestData = value.trim();<br>        scheduleRead(); // schedule next read<br>      });<br>    }<br>    scheduleRead();<br><br>  } catch (err) {<br>    status = &quot;error: &quot; + err.message;<br>  }<br>}<br><br>function draw() {<br>  showScaledImage(donut);<br>  showScaledImage(bag[bagState], 300, 300, 30, 230);<br>  if (latestData !== &quot;&quot; &amp;&amp; !isNaN(latestData)) {<br>    let val = Number(latestData);<br>    setBagState(val)<br>  }<br>}<br><br>function showScaledImage(<br>  img, <br>  w=windowWidth, <br>  h=windowHeight, <br>  x=0, y=0){<br>  let scale = min(w/ img.width, h / img.height);<br>  image(<br>    img,x,y,<br>    img.width * scale,<br>    img.height * scale<br>  );<br>}<br><br>function setBagState(candyAmount){<br>  if (candyAmount &lt; 26) {<br>    bagState = &quot;empty&quot;;<br>  }else if (candyAmount &lt; 178){<br>    bagState = &quot;bit&quot;;<br>  }else if (candyAmount &lt; 398){<br>    bagState = &quot;some&quot;;<br>  }else{<br>    bagState = &quot;many&quot;;<br>  }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cab32fd9323" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Somaesthetic Design Exercise]]></title>
            <link>https://medium.com/@cheska.p/somaesthetic-design-exercise-b5859371fb99?source=rss-1599a0efe8e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5859371fb99</guid>
            <dc:creator><![CDATA[Cheska P]]></dc:creator>
            <pubDate>Wed, 23 Sep 2026 07:40:43 GMT</pubDate>
            <atom:updated>2026-09-23T07:40:43.579Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Elle O Hill, Navya Batra, Qazybek Beken, Cheska Peralta</em></p><p>For our Somaesthetic Design Exercise, we had to group ourselves into teams of four and partner up. Each pair in the team had to complete two exercises: breathing and walking back-to-back. Our goal as a group was to document and discuss how we experienced the small sensory details that we tend to ignore in our everyday lives.</p><h3>Exercise 1: Breathing</h3><p>The breathing exercise involved each person sitting back-to-back with their partner, closing their eyes, and focusing on their breathing. At first, we had to simply pay attention to our own breathing. We became more conscious of how we were breathing. Elle mentioned that she would breathe through her mouth. Then, we had to try to feel our partner’s breathing. Qazybek noted that Cheska would take longer breaths and Cheska said that Qazybek took longer exhales.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*mIW0zGvtwEH7MF8DA8o2vA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*tQIIItY6ULN4AN8O8sFeQQ.png" /></figure><p>After that, each pair had to let one person lead the pace in breathing and then switching. Elle and Navya tried this exercise both sitting and standing, and they noticed that when they stood up, it was easier to feel the other’s upper body movements. When they were sitting while leaning forward, they realized that they would try to feel each other’s movement near the abdomen which made it harder. But when they were standing back-to-back they could easily feel each other’s breathing through their backs which had bigger movements.</p><h3>Exercise 2: Walking Back-to-Back</h3><p>Walking back-to-back was easier said than done. Each pair initially avoided using their sight to check when they should take a step.</p><p>Cheska attempted to feel Qazybek’s foot movements, waiting for his shoes to hit hers. However, wearing shoes made it difficult to sense with touch if the other’s foot followed. Qazybek, on the other hand, was worried about the height and weight difference; if he moved backward too fast, he might topple over Cheska. They both decided to use their sight as a way to know when to take the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*NfZX5uMHhkaZ1MVQWfja0w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*G39GHxT2X23B1Wj4TvzGgg.png" /></figure><p>Elle and Navya also had the same first attempt. They both relied on the feeling of the heel or on some occasions, accidentally stepping on the other. The two of them were able to feel some back movement while they were walking, but they noted that it was unreliable. They tried walking on the concrete pathway and the grass to listen to each other’s steps. At the end, Elle and Navya both decided to look down and use their sight to reliably know when the other has taken a step.</p><h3>Midterm Project Takeaways</h3><p>The exercises allowed us to focus on the subtle bodily sensations that we often overlook, such as breathing, movement, and footsteps. We also noticed how body positioning can change how we feel our surroundings and how we default to using sight if other options feel unreliable. These findings will help us in our midterm project by reminding us to consider how people physically sense and interact with an object. We need to take into account what position they will be in when interacting with our TUI and actively think about how we can provide feedback that engages other senses instead of defaulting to visual cues.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5859371fb99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab 3: Sensing using Potentiometers]]></title>
            <link>https://medium.com/@cheska.p/lab-2-sensing-using-potentiometers-2d79219b7a9d?source=rss-1599a0efe8e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d79219b7a9d</guid>
            <dc:creator><![CDATA[Cheska P]]></dc:creator>
            <pubDate>Mon, 21 Sep 2026 18:58:32 GMT</pubDate>
            <atom:updated>2026-09-28T11:36:23.702Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TQLH5CgVyqiWY30ZlkjGbA.jpeg" /></figure><p>The goal of our third lab was to play with Potentiometers and how we can use it to interact with LEDs. There were two options to choose from: 2 Potentiometers or 3 Potentiometers. The first option looked more fun since it involved being able to modify the blink rate and brightness versus one color per potentiometer.</p><p>I decided to build off from the base code provided from us. It was a simple tweak, just add another potentiometer pin! I also made a function called setPins to make it easier to modify all pins at once.</p><p>For the brightness value, since the expected LED values were only up to 255, I divided the received value from the brightness potentiometer by 4 as given by the sample code here: <a href="http://owenmundy.com/blog/2010/05/fading-an-led-with-pwm-and-a-potentiometer/">http://owenmundy.com/blog/2010/05/fading-an-led-with-pwm-and-a-potentiometer/</a></p><p><strong>Code</strong></p><p>I modified the base code provided here: <a href="https://docs.arduino.cc/built-in-examples/analog/AnalogInput/">https://docs.arduino.cc/built-in-examples/analog/AnalogInput/</a></p><pre>const int redPin = 9;<br>const int greenPin = 10;<br>const int bluePin = 11;<br><br>int blinkPin = A0;   // select the input pin for the potentiometer<br>int blinkValue = 0;  // variable to store the value coming from the sensor<br>int brightPin = A1;   // select the input pin for the potentiometer<br>int brightValue = 0;  // variable to store the value coming from the sensor<br><br>void setup() {<br>  Serial.begin(9600);<br>  pinMode(redPin, OUTPUT);<br>  pinMode(greenPin, OUTPUT);<br>  pinMode(bluePin, OUTPUT);<br>}<br><br>void loop() {<br>  blinkValue = analogRead(blinkPin);  // 0–1023<br>  brightValue = analogRead(brightPin)/4;<br>  Serial.print(&quot;Brightness value: &quot;);<br>  Serial.println(brightValue);<br><br>  Serial.print(&quot;Blink Value: &quot;);<br>  Serial.println(blinkValue);<br>  // turn the ledPin on<br>  setPins(brightValue);<br>  // stop the program for &lt;sensorValue&gt; milliseconds:<br>  delay(blinkValue);<br>  // turn the ledPin off:<br>  setPins(0);<br>  // stop the program for &lt;sensorValue&gt; milliseconds:<br>  delay(blinkValue);<br>}<br><br>void setPins(int brightness){<br>  analogWrite(redPin, brightness);<br>  analogWrite(greenPin, brightness);<br>  analogWrite(bluePin, brightness);<br>}</pre><p><strong>Components</strong></p><ul><li>3 Resistors (220Ω)</li><li>1 Breadboard</li><li>Wires</li><li>USB-C Connector for Arduino</li><li>1 Red LED</li><li>1 Blue LED</li><li>1 Green LED</li><li>2 Potentiometers</li></ul><p><strong>Schematic Diagram</strong></p><p>I used <a href="https://www.tinkercad.com/">Tinkercad</a> for this!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x64cpv9j6kTqOXhlA1T3MA.png" /></figure><p><strong>Video</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FRteez3NbZCo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DRteez3NbZCo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FRteez3NbZCo%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c45b924ec07e735757e75eee217bc6d/href">https://medium.com/media/6c45b924ec07e735757e75eee217bc6d/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d79219b7a9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>