<?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 Cassius Palacio on Medium]]></title>
        <description><![CDATA[Stories by Cassius Palacio on Medium]]></description>
        <link>https://medium.com/@cassiusp?source=rss-8cf63d0321cd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*eGNr0rqAJ_3WnOAMZaL1jQ.jpeg</url>
            <title>Stories by Cassius Palacio on Medium</title>
            <link>https://medium.com/@cassiusp?source=rss-8cf63d0321cd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 22:33:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cassiusp/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[W2 E2 — TDF PhysComp]]></title>
            <link>https://medium.com/@cassiusp/w2-e2-tdf-physcomp-eac642b391b3?source=rss-8cf63d0321cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/eac642b391b3</guid>
            <category><![CDATA[physcomp]]></category>
            <category><![CDATA[uc-berkeley]]></category>
            <dc:creator><![CDATA[Cassius Palacio]]></dc:creator>
            <pubDate>Sat, 31 Oct 2026 01:45:11 GMT</pubDate>
            <atom:updated>2026-10-31T01:45:11.351Z</atom:updated>
            <content:encoded><![CDATA[<p>Week 2, Entry 2<br>Technology Design Foundations — Physical Computation</p><p>Thursday was ring day. Everyone brought their laser-cut ring, the class put them all up on slides and voted. Then the session pivoted twice: first to gears and linkages, a preview of the Expressive Mechanics project, then to 3D printing, which turned the ring brief inside out.</p><h3>The ring review: a 737 across two fingers</h3><p>My entry for the review was the two-finger 737 from my last entry. Getting it from concept to cut took three decisions.</p><p><strong>Fit.</strong> I measured my finger at 2.70 inches around, which works out to a hole about 21.8 mm across. The laser burns away roughly 0.15 mm of kerf, so fit-critical edges were offset to compensate. I didn’t fully trust the math, so a fit test strip with holes at 21.3, 21.8 and 22.3 mm went on the sheet to cut first.</p><p><strong>The file.</strong> My first file used four kinds of marks: red cuts, blue scores, green etches and gray gradient fills. The shop takes red and blue only. Losing the gradients meant drawing the fuselage’s roundness instead: rows of scored lines packed tighter toward the edges, which is hatching done by a laser.</p><p><strong>Scale.</strong> The brief said make it big, so I did:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*3ieOCFa04hZlt8zVRoTvew.png" /></figure><p>Scale paid for itself in detail. The fuselage now steps down in three layers (20, 14 and 10 mm wide), the windows became individual scored dashes, and doors and overwing exits appeared. It also had costs: a four-plate band about 12.7 mm wide, an optional fin 43 mm tall, one ring per sheet, and no fist while wearing it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*q6aHGOo1vctIRTja.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*BEKjbv1lJoJv7FEyTD45dg.png" /></figure><h3>Gears and linkages: how a mechanism gets made</h3><p>The gears and linkages section previewed Expressive Mechanics through one maker’s process, Mo’s, step by step:</p><ol><li><strong>Sketch first,</strong> with notations and callouts. The drawing is where dimensions get decided.</li><li><strong>Go low fidelity.</strong> Popsicle sticks, string and a jar lid were enough to check that a motion works at all.</li><li><strong>Quick fabrication.</strong> Foam board and tape tested the full layout with a real motor in place.</li><li><strong>Add components.</strong> Cardboard arms, discs and slots, cut fast and cheap.</li><li><strong>Laser cut</strong> the final parts in plywood, plus extras, because something always breaks.</li><li><strong>3D print what flat sheet can’t do,</strong> like motor mounts and drive shaft adapters.</li><li><strong>Test tolerance.</strong> A strip of quarter-inch holes from 0.23 to 0.26 inches shows exactly which size gives a dowel a free spin and which one binds.</li><li><strong>Sand everything first.</strong> Smooth edges cut friction before assembly.</li></ol><p>The Expressive Mechanics brief compresses that into a loop: test, tolerance, build, sand, repeat. The design advice was equally short. Build one simple mechanism, then repeat it. Complexity comes from repetition, not from one clever part.</p><h3>3D printing, from the beginning</h3><p>The second half opened with a pop quiz on the three ways to make a physical object:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7-fZ48SaQYvl8FCQBqwFkA.png" /><figcaption>That last row describes my ring exactly. I built a volume from stacked flat layers, by hand, on a subtractive machine.</figcaption></figure><p><strong>Who invented it? It’s complicated.</strong> Chuck Hull usually gets the credit, but the history is crowded:</p><blockquote><strong>1981</strong></blockquote><blockquote>Hideo Kodama in Japan receives the first patent for a device that cures photopolymer with UV light</blockquote><blockquote><strong>1984</strong></blockquote><blockquote>French inventors Alain Le Méhauté, Olivier de Witte and Jean Claude André file a patent, later abandoned for having no economic future</blockquote><blockquote><strong>1984</strong></blockquote><blockquote>Chuck Hull patents stereolithography (SLA)</blockquote><blockquote><strong>1987</strong></blockquote><blockquote>Hull invents the STL file format and founds 3D Systems</blockquote><blockquote><strong>1987</strong></blockquote><blockquote>Carl Deckard files a patent for selective laser sintering (SLS)</blockquote><blockquote><strong>1989</strong></blockquote><blockquote>S. Scott Crump patents fused deposition modeling (FDM) and co-founds Stratasys</blockquote><p>The abandoned French patent is the detail I keep thinking about. An invention can be right and still arrive before anyone knows what it’s for.</p><p><strong>What we print with.</strong> The class/studio uses FDM, which melts thermoplastic filament and lays it down layer by layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KfubFRrpB46p1YV310Id5g.png" /><figcaption><strong>Settings for success:</strong> go big, use layer heights of 0.20 mm or more, skip high-resolution prints, keep infill under 15% and add a brim for bed adhesion. The underlying rule is design for additive manufacturing: a part drawn for a laser cutter or a mill won’t use what a printer does best.</figcaption></figure><h3>The next brief: the ring, printed</h3><p>The homework brings it all together in two parts:</p><ul><li><strong>Part one: recreate the laser-cut ring for 3D printing.</strong> Import the Illustrator file into Fusion 360, extrude it to match the plywood, and print an exact copy. Whatever comes out is what gets turned in, because the point is to see the difference between the two machines.</li><li><strong>Part two: design a second ring for 3D printing.</strong> No wall thinner than 1.5 mm, no detail smaller than 1 mm. Go big.</li></ul><p>For the 737, part one raises real questions. My stacked plywood layers could print as one solid body, but the scored lines have no equivalent: a printer can’t score, so every window and panel seam would have to become raised or recessed geometry. The 1 mm detail rule replaces the laser’s 2 mm limit, which helps the wingtips. And the brim and layer-height rules matter more on a part this large.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zJZ5-ZkqlmDBtv5bTqKoZA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i-wsq3FLmEKhpUy28nG_FQ.png" /></figure><h3>Reflection</h3><p>The through-line of this session was translation between machines. My ring was an additive idea, a stack of layers, built on a subtractive machine. Now the brief asks me to carry it to an additive one and watch what survives.</p><p>Mo’s process gave me a vocabulary for that. Sketch, go low fidelity, test tolerance, sand, repeat. Going into Expressive Mechanics, I want to treat every joint and every hole that way: assume the first size is wrong and cut a strip to prove it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eac642b391b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[W2 E1 — TDF PhysComp]]></title>
            <link>https://medium.com/@cassiusp/w2-e1-tdf-physcomp-f884e30fba15?source=rss-8cf63d0321cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f884e30fba15</guid>
            <dc:creator><![CDATA[Cassius Palacio]]></dc:creator>
            <pubDate>Sat, 31 Oct 2026 01:34:38 GMT</pubDate>
            <atom:updated>2026-10-31T01:34:38.234Z</atom:updated>
            <content:encoded><![CDATA[<p>Week 2, Entry 1<br>Technology Design Foundations — Physical Computation</p><p>A quick poll showed where everyone stood after one week of working alone:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*ZItkVV2g-hXn4m6Mi78mAg.png" /><figcaption>My exercises from last entry put me in the first two rows.</figcaption></figure><h3>Reading the board</h3><p>The lecture went back to basics, and I needed it. A breadboard has three zones:</p><ul><li><strong>Power rails</strong> run the full length of each long edge, one red (+) and one blue (minus). They are separate unless you bridge them.</li><li><strong>Terminal strips</strong> are short rows of five connected holes, the places where components meet.</li><li><strong>The center divider</strong> splits the board, so a strip on one side never touches the strip across from it.</li></ul><p>Nearly every wiring bug I hit in my TUI labs lives in that list: a rail nobody bridged, a part sitting in two different strips, a connection that never crossed the divider.</p><p>Wire colors are the other half of reading a circuit. Conventions vary (ATX power supplies use yellow for 12V and red for 5V), and TDF adds orange for 3.3V. For now the class rule is simple:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*f-twSVKe6CCweHNtP50rBQ.png" /></figure><p>It’s the same lesson as a well-layered architectural drawing. Consistent color is what lets someone else, or you next week, read the board at a glance.</p><h3>Diagrammatic analysis: the voltage divider</h3><p>The last concept of the day explained something I had already used without fully understanding: why every photoresistor needs a 10kΩ partner. It’s also my diagrammatic analysis for this journal submission.</p><p>An Arduino’s analog pins read <strong>voltage</strong>, from 0 to 5V, as a number from 0 to 1023. A photoresistor doesn’t make voltage. It only changes its resistance with light. A voltage divider bridges that gap: two resistors in series between 5V and ground, with the analog pin reading the point between them.</p><blockquote>5V<br> |<br> [ LDR ] resistance changes with light<br> |<br> + — — → A0 reads the voltage at this node<br> |<br> [ 10kΩ ] fixed<br> |<br> GND</blockquote><p>The voltage at the middle node depends on how the two resistances compare, where R1 is the top resistor and R2 the bottom one:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*ncz_alviSvYU8xcUjr3Hkg.png" /></figure><p>If the LDR’s resistance drops, more of the 5V lands across the fixed resistor and the reading changes. Which way it changes depends on whether the LDR sits above or below the node. That detail was the root of a bug in my TUI Lab 05: my code assumed bright light meant a high reading, but the way my divider was wired, it meant a low one. The diagram would have told me before the code did.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZJX9-2ngzScrjg_l.png" /></figure><h3>Homework: motion and presence</h3><p>The tutorial continued, and the new homework moved from light to motion: make something interesting happen with a <strong>servo motor</strong> and an <strong>ultrasonic or PIR sensor</strong>, documented with a video, images, code and circuit diagrams.</p><p>The two sensors see the world differently. An ultrasonic sensor measures distance by timing an echo, so it knows how far away you are. A PIR sensor detects changes in infrared heat, so it only knows that something warm moved. A servo turns to a set angle on command.</p><p>For the servo, I drew on a project from my Tangible User Interfaces class: a cuckoo clock built with my team, where one servo drives both the trap door and the bird. <em>(Adapted from our team project. Elizabeth Wang published the full write-up as “Output: Simple Mechanics” on Medium.)</em></p><p><strong>Driving a servo.</strong> A hobby servo has three wires: power, ground and signal. The signal wire goes to an Arduino pin, and the Servo library sends it a target angle with write(). The servo turns to that angle and holds it. That position control is what makes a servo useful for choreography.</p><p><strong>The limit that shaped the design.</strong> A standard servo sweeps only about 0 to 180 degrees. We wanted a cam to push the bird, but a true cam expects continuous rotation. So the sequence had to fit inside one sweep: the door opens on the way out, the bird follows a few degrees later, and both return on the way back. The timing lives in the code, as a sweep with a pause at the “bird out” angle.</p><p><strong>Where the sensor comes in.</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FFkNpCSMsqDo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DFkNpCSMsqDo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FFkNpCSMsqDo%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/127c6162e876a5a1033794eda6396c6c/href">https://medium.com/media/127c6162e876a5a1033794eda6396c6c/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nQRcvU1ISt9dRyIe.jpeg" /></figure><h3>Reflection</h3><p>This session was mostly review, and that’s why it mattered. In my first week I could make circuits work by copying layouts. Now I can explain why they work: why the rails need bridging, why the colors matter, why a photoresistor needs a partner resistor.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f884e30fba15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[W1 E2 — TDF PhysComp]]></title>
            <link>https://medium.com/@cassiusp/w1-e2-tdf-physcomp-ea0f7cbf61ea?source=rss-8cf63d0321cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea0f7cbf61ea</guid>
            <dc:creator><![CDATA[Cassius Palacio]]></dc:creator>
            <pubDate>Sat, 31 Oct 2026 01:17:45 GMT</pubDate>
            <atom:updated>2026-10-31T01:17:45.941Z</atom:updated>
            <content:encoded><![CDATA[<p>Week 1, Entry 2<br>Technology Design Foundations — Physical Computation</p><p>Tuesdays are electronics. Thursdays are fabrication. After a first session spent with LEDs and resistors, the second class traded the breadboard for the laser cutter. So I designed a ring that says something about who I am; I answered with an airplane.</p><h3>Laser cutting, briefly</h3><p>Digital fabrication splits into two families. Laser cutting is subtractive: it takes material away. 3D printing is additive: it builds material up. Both start from a CAD file, which is what makes them fast to iterate.</p><p>A laser cutter cuts, etches and rasters sheet material from a 2D drawing. Mirrors steer the beam to a nozzle, a lens focuses it to a spot a fraction of a millimeter wide, and that spot melts or vaporizes the material. Assist gas clears the debris from the kerf, the thin channel the beam leaves behind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*zXcowEjB5cWo8aNCOUJKTQ.png" /></figure><p>The safety slide made the point with a warning sign about not looking into the beam with your remaining eye. Our shop machines are enclosed, interlocked and low power compared to industrial lasers, but materials are restricted for a reason, and completing the online laser training was the price of admission.</p><h3>How flat parts become objects</h3><p>The heart of the lecture was joinery: how flat sheets become three-dimensional things. It opened with a provocation about the most familiar joint of all.</p><p><strong>Finger joints (slot and tab)</strong> are the most widely used and most abused. A few simple tabs make a clean box. Dozens of tiny ones make what the slides called the Etsy look, the mark of an amateur. The rule: limit the number and control the size.</p><p>The alternatives, each with its own job:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hX0NcJUhJdaWZEHzqArhOg.png" /></figure><p>Kerf bending has a trade-off worth remembering: closer cuts and smaller bridges give tighter bends but weaker hinges. A slide of snapped flex hinges made that clear.</p><p>As an ex-architect, stack and frame felt like home. It is a section model: cut the object at regular heights, then stack the slices back into a volume. That idea ended up shaping my ring.</p><h3>The brief</h3><p>Create a ring that describes a part of your personality or a cause you believe in. Make it bold, make it big, have fun with it. Three constraints:</p><ul><li><strong>Simplicity.</strong> A ring is small, so fine detail gets lost. Think big and outlandish.</li><li><strong>Fit.</strong> It has to fit the finger it was designed for, so measure carefully.</li><li><strong>Finish.</strong> Sand away sharp and burnt edges.</li></ul><p>The file rules are strict: an Illustrator layout with RGB red (255) strokes at 0.001 inch for cuts. Anything else, the machine either ignores or treats differently.</p><h3>My ring: a 737 across two fingers</h3><p>My answer is a two-finger ring, index and middle, carrying a Boeing 737 seen from above, wings spread across my knuckles.</p><p><strong>From flat to volumetric.</strong> A plane is a volume, and a laser cutter only cuts flat sheet. So I borrowed the stack and frame idea and built the plane in layers on 1/8&quot; plywood:</p><ol><li><strong>Band:</strong> flat plates with two finger holes, glued face to face for strength.</li><li><strong>Planform:</strong> wings, stabilizers and fuselage as one piece, with flaps, ailerons and slats scored in.</li><li><strong>Fuselage:</strong> a raised body layer, with windows and panel seams scored on top.</li><li><strong>Crown:</strong> a narrow strip along the spine for a third step of roundness.</li><li><strong>Engines:</strong> two-layer nacelles glued under the wings.</li><li><strong>Fin:</strong> an optional vertical tail, left off if it snags.</li></ol><p>Each step up reads as curvature. Dense rows of scored lines along the fuselage edges fake the shading that a raster engrave would normally do.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea0f7cbf61ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[W1 E1 — TDF PhysComp]]></title>
            <link>https://medium.com/@cassiusp/w1-e1-tdf-physcomp-23bf40edd487?source=rss-8cf63d0321cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/23bf40edd487</guid>
            <category><![CDATA[uc-berkeley]]></category>
            <category><![CDATA[physcomp]]></category>
            <dc:creator><![CDATA[Cassius Palacio]]></dc:creator>
            <pubDate>Sat, 31 Oct 2026 00:55:12 GMT</pubDate>
            <atom:updated>2026-10-31T00:55:12.600Z</atom:updated>
            <content:encoded><![CDATA[<p>Week 1, Entry 1<br>Technology Design Foundations — Physical Computation</p><p>Half a semester of Computational Design taught me to build with models, APIs and prompts. This week the screen went down and a plastic box of parts came up. I have moved to the Physical Computing track of Technology Design Foundations (TDF) at Berkeley MDes, and this first entry covers the kickoff: what the section is for, what is in the kit, and the first circuits on my bench.</p><h3>Serious play, doing over thinking</h3><p>TDF exists to build fluency with emerging technology as a design material. The course frames it as a place to build competency in technology that matters to contemporary practice, then use that judgment to fold technology into real design work.</p><p>The teaching team (Sudhu Tewari on electronics and programming, Chris Myers on fabrication and prototyping, Alistair Vizuet as GSI on mechanical engineering) named three values up front:</p><ul><li><strong>Serious play.</strong> Experiment on purpose.</li><li><strong>Doing over thinking.</strong> Build first, theorize after.</li><li><strong>Making m1stak3s.</strong> Errors are data, not failures.</li></ul><p>Underneath all three sits one word repeated: iteration, iteration, iteration.</p><h3>The road ahead: eight weeks, three stages</h3><p>The Physical Computing half moves fast. Everything below lands in roughly eight weeks:</p><ol><li><strong>The basics (2 weeks).</strong> A charrette of skill builders: laser cut rings, 3D printed rings and microcontroller exercises. Tuesdays are electronics, Thursdays are fabrication and prototyping.</li><li><strong>Expressive Mechanics (2 weeks).</strong> The first foundational project, about motion that communicates.</li><li><strong>Ambient Display (2.5 weeks).</strong> The second, about information that lives quietly in a space.</li></ol><h3>Opening the box</h3><p>Every student gets the same compartmented kit. Laid out, it reads like a vocabulary list for the next eight weeks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*qBjKBlR9Tk-nBcMaMIulyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f4A8DiLCOHshUB-_EmXmFQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fXFpFcvrydYD6dB268gzfw.png" /></figure><h3>Learning to read stripes</h3><p>Before any code, we learned to read resistors. Each colored band stands for a digit (black 0, brown 1, red 2, orange 3, yellow 4, green 5, blue 6, violet 7, grey 8, white 9). The digit bands come first, then a multiplier, then tolerance. On a 5-band resistor, yellow violet black black brown decodes to 4, 7, 0, times 1, plus or minus 1%: 470Ω.</p><p>The kit holds four values, each with a job:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*XBw_2lDfFf8AMwafx6Qlpw.png" /></figure><p>When in doubt, the <a href="https://www.digikey.com/en/resources/conversion-calculators/conversion-calculator-resistor-color-code">DigiKey resistor color code calculator</a> settles it. As an architect, I appreciated that this is a drawing convention like any other: a compressed notation you learn once and then read at a glance.</p><h3>First circuits</h3><p>In class we started <a href="https://github.com/loopstick/ArduinoTutorial">Dr. Sudhu’s Arduino Tutorial</a>, aiming to reach the RGB LED section. Prep work included installing the <a href="https://www.arduino.cc/en/software/">Arduino IDE</a> and taking <a href="https://learn.adafruit.com/ladyadas-learn-arduino-lesson-number-0">Lady Ada’s Arduino tour</a>.</p><h3>Exercise 1: Blink while saying hello</h3><p>The first task: flash the onboard LED while printing “Hello World” to the serial monitor.</p><pre>void setup() {<br>  pinMode(LED_BUILTIN, OUTPUT);<br>  Serial.begin(9600);<br>}<br><br>void loop() {<br>  digitalWrite(LED_BUILTIN, HIGH);<br>  Serial.println(&quot;Hello World&quot;);<br>  delay(500);<br>  digitalWrite(LED_BUILTIN, LOW);<br>  delay(500);<br>}</pre><h3>Exercise 2: One LED, one LDR</h3><p>The brief: make “something interesting” happen with one LED and one photoresistor. I had already built this one. For my Tangible User Interfaces Lab 05, I made a light-gated Theremin on an Arduino Uno: a potentiometer controls both an LED’s brightness and a piezo’s pitch, and a photoresistor decides whether you get to hear it. Dark room, continuous tone. Bright room, silence. <em>(Adapted from my TUI Lab 05 write-up.)</em></p><p>The idea came from sleep playlists that put frequencies like 432 Hz or 528 Hz front and center. I liked how they make an invisible number feel visible, so I wanted my instrument to show the Hz you’re making.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EDx5YMaS6sVNLuAgvpzDDA.png" /></figure><p>The photoresistor needs that 10k partner because it only changes resistance. Paired with a fixed resistor, it forms a voltage divider the Arduino can read as a voltage. That is exactly what the kit’s 10kΩ resistors are for.</p><p><strong>The bug that taught me the most.</strong> My first build didn’t work, and the Serial Monitor showed why. The pot and the LDR were both bouncing between the same two values, 428 and 692. Two different sensors with identical readings means neither is wired where the code thinks. GND and A0 were swapped at the header, and one power rail had no 5V. After fixing both, the LDR read 969 in the dark and 49 in bright light.</p><p>That also exposed a logic error: in my divider, bright light gives a <em>low</em> reading, so my comparison was backwards. The final cutoff:</p><pre>if (potValue &lt;= 5 || ldrValue &lt; 210) {<br>  noTone(PIEZO_PIN);<br>}</pre><p>I then smoothed the knob with a moving average and mapped pitch logarithmically (100 to 2000 Hz) so the sweep sounds even. A companion web page turns the pitch into a gradient that rises and warms as the Hz climbs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*O2qsfaCazzHh7Q7k.gif" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FLsINTwnH_KI%3Fstart%3D13%26feature%3Doembed%26start%3D13&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DLsINTwnH_KI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FLsINTwnH_KI%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/05b709dfff107a7e064141cf4f0829f8/href">https://medium.com/media/05b709dfff107a7e064141cf4f0829f8/href</a></iframe><h3>Exercise 3: Two or more LEDs</h3><p>For two or more LEDs, I went back to my very first TUI lab. After watching a police car chase someone down near Berkeley Street, I wanted to recreate that flash pattern. The result is a two-light alternating flasher: LEDs on pins 12 and 11, each with its own 220Ω resistor, both returning to a shared ground rail, flashing in alternating bursts of three. <em>(Adapted from my TUI Lab 1 write-up.)</em></p><p>I prototyped it in Tinkercad first. Partly for confidence, partly because I have large hands and didn’t want to bend the breadboard’s prongs while still learning where things go. Simulating first let me make mistakes for free, then move a layout I trusted onto the real board.</p><p>Most of my problems were wiring, not code. My first external LED stayed dark because it was in backwards: an LED only conducts one way and gives no warning. I also learned that breadboard strips connect in short groups of five holes, so laying parts in a neat line connected nothing. And with two LEDs, both had to route back to one shared ground rail.</p><p>This is where the I/O pins clicked for me. Each pin is individually addressable: pinMode() declares it an output and digitalWrite() signals that one pin. The two LEDs don&#39;t share a signal. Each gets its own, timed against the other in the loop. The physical build behaved exactly like the simulation, with one surprise: my knuckle brushed a resistor and I could feel it warming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/0*VnsvjBRg3hIMJiai.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*pT-bwEXXb8o00rib.gif" /></figure><p><strong>What worked:</strong> Simulating in Tinkercad before touching hardware, and printing sensor values to the Serial Monitor before changing any code.</p><p><strong>What broke:</strong> A backwards LED, a swapped GND and A0 wire, and an unpowered rail. Every one was wiring. Identical or frozen readings almost always mean a connection problem, not a logic problem.</p><h3>Reflection</h3><p>Coming from Computational Design, the contrast is the lesson. In software, a mistake costs a refresh. On a breadboard, a mistake costs a burned LED or a wire in the wrong row, and you feel it. That friction slows me down in a useful way: I have to understand the circuit before the code means anything.</p><p>It also connects to my other work this fall. In Tangible User Interfaces we are designing physical interactions, and this kit is the toolset that turns those sketches into working objects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23bf40edd487" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab №7: Monkey Crawler — TUI]]></title>
            <link>https://medium.com/@cassiusp/lab-7-monkey-crawler-tui-de40e24627cf?source=rss-8cf63d0321cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/de40e24627cf</guid>
            <dc:creator><![CDATA[Cassius Palacio]]></dc:creator>
            <pubDate>Mon, 19 Oct 2026 18:56:27 GMT</pubDate>
            <atom:updated>2026-10-20T17:47:05.737Z</atom:updated>
            <content:encoded><![CDATA[<p>Cassius Palacio and Kenya Foster. Professor Kimiko Ryokai. Tangible User Interfaces, Fall 2026</p><p>This week we were introduced to servo motors. These motors work with Pulse Width Modulation (PWM) to discretize incremental steps as the servo rotates. It’s also interesting to note that servo motors are geared toward torque motion, rather than simply rotatory motion. We noticed last week that the DC motors could ramp up quite a bit of speed, however this came at a trade-off to their strength. This week servos pose the opposite. They generate more torque (applied force at an angle about a point) than the DC motors. This allows them to handle a heavier load, while still being able to perform rotation.</p><p>We’ve been prompted to build a ‘crawler’ with our servos, to then race with in the following class. We were able to team with another member to combine our Servo motors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A_Z_KomA8Cbo9HYz40J0qw.png" /><figcaption>Visual Mockup of how we wanted our Crawler to look</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c-RglHPb3cc_gMpmC6HQLw.png" /><figcaption>Kit of Parts to 3D Print our Crawler</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OiONWnsppDOmU39RtK1ygQ.png" /><figcaption>Our Crawler having issues with installation (I got the servo measurements wrong)</figcaption></figure><h3>Setup</h3><blockquote>(1) Arduino UNO R3</blockquote><blockquote>(1) Mini Breadboard</blockquote><blockquote>(2) SG90 MicroServo motors</blockquote><blockquote>Jumper Cables</blockquote><blockquote>(1) Power Cord</blockquote><h3>Code</h3><pre>#include &lt;Servo.h&gt;<br><br>Servo Left;   //  pin 12<br>Servo Right;    // pin 13<br><br>//const unsigned long SPIN_MS = 1000;  // time spent in each direction<br>//const unsigned long STEP_MS = 17;    // ~3 s per 0-&gt;180 sweep (180 steps x 17 ms)<br>const int pinLeft = 13;<br>const int pinRight = 12;<br><br>const int homeLeft = 90;<br>const int homeRight = 90; <br><br>// step sizes<br>int leftStep = 80;<br>int rightStep = 80;<br><br>void setup() {<br>  Left.attach(pinLeft);<br>  Right.attach(pinRight);<br><br>  resetToNeutral();<br>  delay(200);<br>}<br><br>void loop() {<br>  simultaneousStride();<br>}<br><br>void resetToNeutral(){<br>  Left.write(homeLeft);<br>  Right.write(homeRight);<br>}<br><br>void simultaneousStride(){<br>  Left.write(homeLeft + leftStep);<br>  Right.write(homeRight + rightStep);<br>  delay(200);<br><br>  Left.write(homeLeft - leftStep);<br>  Right.write(homeRight - rightStep);<br>  delay(200);<br>  <br>}</pre><h3>Artifacts</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FocAuICSPzIU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DocAuICSPzIU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FocAuICSPzIU%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/006304096d4b2a33d0152d167dffbd91/href">https://medium.com/media/006304096d4b2a33d0152d167dffbd91/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de40e24627cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[W8 E1 — TDF DesComp]]></title>
            <link>https://medium.com/@cassiusp/w8-e1-tdf-descomp-ff8b2b40409f?source=rss-8cf63d0321cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff8b2b40409f</guid>
            <category><![CDATA[computation-design]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Cassius Palacio]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 06:01:04 GMT</pubDate>
            <atom:updated>2026-10-31T00:37:15.164Z</atom:updated>
            <content:encoded><![CDATA[<p>Week 8, Entry 1<br>Technology Design Foundations — Design Computation</p><h3>The Demo That Didn’t Work on Demo Day</h3><p>Our DigiPhant final presentation, the bugs that showed up live, and what ten days of iteration actually looked like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oqqZDdRdiovPbw1hb_Tlog.png" /><figcaption><em>Our opening slide. Three people, one webcam, one elephant.</em></figcaption></figure><p>On Tuesday, Team Paladin presented DigiPhant: a digital twin where Rohan, Freddie and I control one elephant in Unity with our bodies, through MediaPipe and a single webcam. The brief asked for a live demo, and we planned one: calibrate together, show each person’s controls, then run our Trunk Trail course.</p><p>The live demo failed. Bugs we hadn’t seen in rehearsal showed up in front of the class, and the elephant didn’t do what we’d spent ten days teaching it to do. I was disappointed, honestly more than I expected to be. We had a system that worked in our sessions at Wurster, and the one run that counted wasn’t it.</p><p>This entry is my attempt to be honest about that, and to show the thinking and iteration behind the project, because this still shows our determination.</p><h3>The deck</h3><p>We kept it to six slides, about 45 seconds each, and built them in Figma around a symbol set designed to match the white-on-color interface of our game. Rohan covered MediaPipe, Freddie covered the game integration, and I covered the integration, system and some features (equal contributions).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o347tZY4VTIf_NJRS67feA.png" /><figcaption><em>Slide 2, how the system works. Perform, see, translate, play, with a feedback loop back to the performers.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qRK3DbUwUkqJX3BfwZ0W3A.png" /><figcaption><em>Slide 3, MediaPipe. Pose Landmarker reads whole-body roles; Gesture Recognizer reads whether a hand is closed.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ojSWbrn7eGY0U4L5XcK0Ng.png" /><figcaption><em>Slide 4, technical details. Six problems we hit in testing and the fix for each.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OvTxJQ-tc7MYsJaGeESzkw.png" /><figcaption><em>Slide 5, the feature wall. 63 symbols for everything we built, in seven rows.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tIjKbNOTaygHsY6j5rh7fA.png" /><figcaption><em>Slide 6, the live demo plan and our formation, beside the Pose Framework whiteboard where we first mapped each performer’s moves.</em></figcaption></figure><h3>How the system actually works</h3><p>The slides show what DigiPhant looks like. This map shows how it works: where each piece of data comes from, where it goes, and which part of the code touches it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ucbz4AbshVr9-_yPm2yE_w.png" /><figcaption><em>System architecture. A Python bridge runs both MediaPipe models on one webcam and sends three streams to Unity over local ports. The red boxes are the preview path, which comes up again below.</em></figcaption></figure><p>Reading it left to right:</p><ol><li><strong>Room.</strong> Three of us stand in fixed zones in front of one webcam.</li><li><strong>Python bridge</strong> (Tracking/bridge.py). Pose Landmarker finds 33 points per body. ZoneTracker decides who is P1, P2 and P3 by where we stand. extract_features turns each body into six numbers. Gesture Recognizer reads hands, and each hand is given to the performer whose wrist is nearest.</li><li><strong>Local ports.</strong> Signals go to Unity on 5055, gestures on 5058 and the camera preview on 5057. Unity sends the number of players back on 5056.</li><li><strong>Unity.</strong> The controller subtracts each person’s neutral pose. Locomotion turns Rohan’s hand into speed and my lean into turning. Pose actions turn held poses into jumps, about-turns and rearing, in a fixed priority order. The trunk layer handles Freddie’s reach and grab. The Adventure script runs the game: rocks, parcels, health and the finish.</li><li><strong>Feedback.</strong> We watch the elephant and the screen and adjust. That loop is the part no code controls.</li></ol><h3>Ten days of iterations</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cZtHDM_Y1ZfeAvPbrH9EVA.png" /><figcaption><em>How the project evolved, from our commit history. The bottom row follows one setting through four versions.</em></figcaption></figure><p>The timeline is the clearest picture of how we worked. Saturday, 4 October was the foundation: pose actions, fixed zones, guided recording and our first tuning session. Thursday the 8th was the busiest day: we imported the supplied course, built our own Trunk Trail, fixed false jumps and re-tuned movement. Monday the 12th turned the course into a game.</p><p>The bottom row is my favourite part, because it shows experimentation more honestly than any feature list. My steering, as P2, went through four versions. The starter needed a lean of 0.12 before the elephant turned, which was too stiff for us. Our first fix dropped that to 0.017, so the elephant turned on ordinary standing sway (64% of the time in my standing test). We swung back to 0.06, which was calm but needed long leans. The final version, fitted to my real lean during play, starts turning at 0.035 and reaches full speed at 0.08. None of those numbers were wrong in isolation. Each one was a guess that a test proved too far in one direction.</p><h3>Iterating through a bug: the jump that fired too often</h3><p>The bug I learned the most from came from a seated test on 8 October. Four deliberate raises made the elephant jump 8 times. Replaying the recorded signals showed why: about 30% of frames had no tracking at all, and our code treated a missing frame as “knee down.” Every time tracking came back, it looked like a brand-new knee lift.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t3YARvIo0WGRkwY--yO32w.png" /><figcaption><em>The fix in DigiPhantPoseActions.cs (commit c85a9356). Red lines removed, green lines added.</em></figcaption></figure><pre>// Before: a lost frame (NaN) reads as &quot;knee down&quot;<br>bool kneeUp = !float.IsNaN(knee) &amp;&amp; knee &gt; kneeLiftThreshold;<br><br>// After: a lost frame is unknown, so keep the last state<br>if (!float.IsNaN(knee))<br>{<br>    bool kneeUp = knee &gt; (seated ? seatedKneeLiftThreshold : kneeLiftThreshold);<br>    if (kneeUp &amp;&amp; !kneeWasUp &amp;&amp; ...) StartJump();<br>    kneeWasUp = kneeUp;<br>}</pre><p>The same fix also split the threshold in two. Seated mode reads the right hand as the knee, and a hand jitters far more than a knee, so seated play now needs a real raise (1.0, about chest height) while standing keeps 0.23.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i78uX4qKHN6VSLpsGYu90Q.png" /><figcaption><em>he jump gate frame by frame. Same input, two rules: before, a held knee fires a jump each time tracking returns; after, it fires once.</em></figcaption></figure><p>This diagram is how I finally understood it. The code wasn’t detecting the wrong pose. It was detecting the right pose and then forgetting it every time the camera blinked. Replaying the recording through the new rule gave 4 jumps for 4 raises.</p><h3>Demo day</h3><p>Looking back at the commit history, the shape of the day is hard to miss. On 8 October we’d agreed on a rule: keep one stable build and one ambitious build, and record a working run before adding anything new. On presentation day we kept building. Three sets of changes were merged that morning and early afternoon: Halloween course polish at 10:54, solo seated hand controls at 12:49, and animated win and lose screens at 14:42. Each one was good work. Together, they meant the version we demoed was hours old and had never had a full three-person run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*p673TM-zMnK44-5YoLEx_Q.jpeg" /><figcaption><em>Adventure mode on the Trunk Trail the day before the presentation: score, health, timer and parcel prompts, with the camera thumbnail in the corner.</em></figcaption></figure><p>When bugs showed up live, we had no time to diagnose them in front of the class. That’s the part that stung. In rehearsal, a bug is information. On stage, it’s just a broken elephant.</p><h4>Bugs that only exist in the built app</h4><p>When I went back through the app after class, the pattern was clear: most of our testing had happened in Unity’s Play mode, and the app is a different environment. Some bugs only exist once the game is packaged. Here are the ones we found and fixed:</p><ul><li><strong>Center Stage moved us between zones.</strong> The MacBook camera’s auto-framing zooms and pans to follow people. Our whole system depends on fixed zones, so when the camera reframed, a performer could slide into a neighbour’s zone and take over their part of the elephant.</li><li><strong>The app couldn’t write its own logs.</strong> In Unity, the log folder sits next to the project. In the app, that path is inside the app bundle, where the folder doesn’t exist. The signal logger threw an error every tenth of a second.</li><li><strong>Features only attached to the first scene.</strong> Code that sets itself up “once per launch” covered the first scene only, so switching courses could leave the menu and hand gestures behind.</li><li><strong>Unity stripped shaders it thought we didn’t use.</strong> Our course setup looks shaders up by name, so Unity removed them from the build and the setup crashed.</li><li><strong>The camera permission prompt never appeared.</strong> The tracker gave up on the camera before macOS could ask for permission.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-bxwCxFHBVNOe5uV_2XUwA.png" /><figcaption><em>The Center Stage fix in Tracking/bridge.py (commit b19a4c79). The tracker now takes control of the camera’s auto-framing and turns it off before opening the camera.</em></figcaption></figure><pre>def disable_center_stage():<br>    &quot;&quot;&quot;Keep the raw camera view. Center Stage zooms and pans,<br>    which moves performers between zones.&quot;&quot;&quot;<br>    send(device, sel(b&quot;setCenterStageControlMode:&quot;), 1)   # the app takes control<br>    send_bool(device, sel(b&quot;setCenterStageEnabled:&quot;), False)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ld7V7aUAC_FK3UbkgcViTw.png" /><figcaption><em>Logs and recordings now go to the app’s own data folder instead of inside the app bundle (commit c8c6b8ae).</em></figcaption></figure><p>None of these showed up in Play mode, because in the Editor the camera, the folders and the tracker all behaved differently. That’s the part I keep thinking about: we tested the thing we built, not the thing we shipped.</p><h4>And one we’d never questioned: the pixelated preview</h4><p>One of the issues we chased that afternoon was the camera preview. Tracking itself was fine, but the preview, which is how we see ourselves while we perform, looked blocky on a big screen. The cause was a trade-off in the bridge that we’d never questioned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j06KElpkkbCB0KsocEusJw.png" /><figcaption><em>encode_preview() in Tracking/bridge.py. Highlighted lines are the bug: every preview frame has to fit in 8,000 bytes.</em></figcaption></figure><pre>scale = min(320 / width, 240 / height)   # never larger than 320 x 240<br>for quality in (65, 45, 25):             # quality drops to 25 in busy rooms<br>    ...<br>    if ok and len(encoded) &lt;= 8000:      # hard cap: 8 KB per frame<br>        return encoded.tobytes()<br>preview = cv2.resize(preview, (w // 2, h // 2))   # then halves: 160 x 120</pre><p>The bridge sends each preview frame as a single network packet, and macOS caps a packet at about 9 KB. To fit, the code shrinks the image to 320 × 240 or smaller and lowers the JPEG quality, and Unity then stretches it up to 1136 × 660 when the preview is enlarged. That was fine on a laptop screen in Wurster. On a projector it fell apart. The lesson for me: a limit that was invisible in our test setup became visible the moment the setup changed.</p><h3>Shipping a standalone app</h3><p>Joris, our professor, inspired us to have DigiPhant to exist outside the Unity Editor: a real macOS app with our own icon that anyone could open without installing Unity or Python. It took two versions to get there.</p><p><strong>Version 1, presentation day.</strong> I built the first app on the afternoon of 13 October. It ran the game, but the camera tracker lived in a separate Tracker folder next to it, and it had to be running before the app opened.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*51TVv5n1QuYBFF5jfvT4bQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QiN-SaaYs0nUyHmyFTHT_A.png" /><figcaption><em>[Left] DigiPhant as an Apple silicon application, built with Unity Player 6000.6.3f1 on 13 October, with the Paladin elephant as its icon. [Right] The Builds folder: the DigiPhant app (423.6 MB), the Tracker folder that ships beside it, and the Unity build log.</em></figcaption></figure><p><strong>Version 2, the day after.</strong> The new build script (tools/build_mac_app.sh) does it all in one step. It freezes our Python tracker, with MediaPipe, OpenCV and every pose and gesture model, into its own small app using PyInstaller. Then it has Unity build the Adventure and Trunk Trail scenes and pack that tracker inside DigiPhant.app. The result runs without Unity, without Python and without the internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vlu7O9siCnrjbdDSgEyz6Q.png" /><figcaption><em>What happens when you open DigiPhant.app. In the Editor, pressing Play started the tracker for us. In the app, every one of these steps had to be built.</em></figcaption></figure><p>The sequence diagram shows why this was harder than clicking Build:</p><ol><li><strong>The app asks for the camera first.</strong> It opens the camera for a moment so macOS shows its permission prompt, then waits up to a minute for Allow. Our tracker couldn’t do this on its own, because OpenCV gives up before the prompt appears.</li><li><strong>The tracker inherits the permission.</strong> The app launches the tracker as a child process, so once you allow the camera, the tracker has it too.</li><li><strong>The tracker is its own little app.</strong> macOS applies camera effects like Center Stage per app, so the tracker needs its own identity (com.teampaladin.digiphant.tracker) to turn Center Stage off.</li><li><strong>Everything it writes goes to Application Support,</strong> never inside the app, so the app’s signature stays intact.</li></ol><p>We also wrote down everything that went wrong as a bug checklist in MAC_APP.md, and our agent instructions in CLAUDE.md now require running it before any build we share. One line in it reads: &quot;Don&#39;t rebuild right before a demo.&quot; Every rebuild re-signs the app, and macOS treats it as a new app that has to ask for the camera again.</p><p>The icon is the same elephant mark from our slides, redrawn as a macOS app icon, so the app, the deck and the game read as one project.</p><h3>What I’m taking away</h3><p>Since the presentation, we’ve patched the bugs and the experience runs the way it was supposed to. That’s a relief, but it doesn’t erase Tuesday, and I don’t want it to. Here is what I’d do differently:</p><ul><li><strong>Freeze the build before demo day.</strong> We wrote the rule ourselves on 8 October (one stable build, one ambitious build) and then broke it on the day it mattered most.</li><li><strong>Rehearse the exact build you’ll show.</strong> Not the same scene in the Editor, but the same app, laptop, projector and room. Play mode and the app are different environments, and most of our app bugs only lived in the second one.</li><li><strong>Test where you’ll perform.</strong> The preview limit only showed up at projector scale, and Center Stage only mattered once people were moving in a real room.</li><li><strong>Write the failures down.</strong> Our MAC_APP.md checklist turns every bug the app has had into a check we run before sharing a build.</li><li><strong>Keep the iteration visible.</strong> The timeline and the diagrams above are the real record of this project. The demo was one run. The thinking behind it took ten days.</li></ul><p>I’m still disappointed. But going back through the commits to write this, I can see how much the system changed and how many of those changes came from things breaking first. That’s the part I want to carry into the next project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff8b2b40409f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[W7 E2 — TDF DesComp]]></title>
            <link>https://medium.com/@cassiusp/w7-e2-tdf-descomp-04a77a585976?source=rss-8cf63d0321cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/04a77a585976</guid>
            <category><![CDATA[computation-design]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Cassius Palacio]]></dc:creator>
            <pubDate>Wed, 14 Oct 2026 19:07:16 GMT</pubDate>
            <atom:updated>2026-10-14T19:07:16.451Z</atom:updated>
            <content:encoded><![CDATA[<p>Week 7, Entry 2<br>Technology Design Foundations — Design Computation</p><h4>From Graphs to Gates</h4><p>The Signals lecture gave names to everything we’d been tuning by trial and error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iTQAUaMdUe14QOARC7totA.png" /><figcaption><em>Continuous, boolean and discrete signals.</em></figcaption></figure><p>Thursday’s lecture sorted every MediaPipe output into three kinds of signal. <strong>Continuous</strong> signals can take any value in a range. <strong>Boolean</strong> signals have two states. <strong>Discrete</strong> signals pick from a small set of named states. Halfway through, I realized our whole elephant is built out of exactly these three things, and that most of our bugs came from treating one kind like another.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*LE1e_5GkuzinSB3gVe6eZQ.jpeg" /><figcaption><em>An early test in MediaPipe Studio, 4 October: Pose Landmarker tracking all three of us at once.</em></figcaption></figure><h4>Continuous: the body as a dial</h4><p>As P1, Rohan drives. His left hand’s height above or below his waist is a continuous signal, and it maps straight to speed: higher is faster, lower is reverse. My lean (P2) maps to turning. Freddie’s right hand height (P3) maps to how far the trunk curls.</p><p>What I didn’t expect was how much of the work lives in the space around zero. Bodies are never still. On 8 October I recorded a standing test and found that my natural sway was about ±0.16. Our steering dead zone was 0.05, so the elephant turned 64% of the time while I was standing “still.” We raised the dead zone to 0.18 and set the run threshold to 0.95, because a normal hand raise for me reaches about 1.3 and was turning every walk into a run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q-Yhm56x3rxulBvJLy9ysw.jpeg" /><figcaption><em>The live readout in Unity: six signals per performer, each measured from that person’s own neutral pose.</em></figcaption></figure><h4>Boolean: graphs into gates</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FYRYxtv4IQU4UeP7RhEHWw.png" /><figcaption><em>A threshold turns a continuous graph into a yes/no gate.</em></figcaption></figure><p>This slide is our pose-actions system in one picture. A jump is a continuous signal (how high Rohan’s right knee lifts) passed through a threshold. The default was 0.45. His knees measured +0.28 to +0.33, so in the starter the jump would almost never have fired. We set it to 0.23. My T-pose was the same story: the default arm-spread threshold of 0.8 never triggered, because his measured spread was +0.41. We set it to 0.2.</p><p>That’s the biggest thing this lecture clarified for me: <strong>a threshold describes a body, not the code.</strong> The right number for one person can be wrong for another. So we stopped guessing. Since we didn’t have a clicker, we built a guided recording mode: an on-screen countdown tells each person which pose to hold, and records each take to its own file. A script then reads the takes and suggests a threshold for each pose, along with a margin showing how far apart the pose and the non-poses really are.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*Io2OjgVb5RKLh0e0dNg1dQ.jpeg" /><figcaption><em>Guided recording: “Stand in your zone,” with a countdown, so all three of us calibrate at the same moment.</em></figcaption></figure><p>Two refinements from the lecture’s “gates” idea made the biggest difference:</p><ul><li><strong>Two thresholds instead of one.</strong> Rearing up turns on at 1.45 and off at 1.21. Freddie’s squat turns on at 0.25 and off at 0.12. With a single line, a hand hovering right at the threshold flickers on and off. With two, it has to clearly cross back before the gate closes.</li><li><strong>Time as a gate.</strong> A T-pose has to be held for 0.6 seconds and arms overhead for 0.4. Holding a pose on purpose is very different from passing through it.</li></ul><h4>Discrete: labels need ownership</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v5x1JStx_xNkXQaMCNX3MQ.png" /><figcaption><em>Gesture Recognizer outputs a named gesture, a confidence score and handedness.</em></figcaption></figure><p>Gesture Recognizer was the additional MediaPipe task our team chose. It gives discrete labels: Open_Palm, Closed_Fist, Victory, Thumb_Up and Thumb_Down. Freddie’s grab is a fist held for 0.35 seconds, and an open palm re-arms it so a held fist can’t grab again and again.</p><p>Discrete signals turned out to need their own kind of care. A gesture label arrives without an owner: the model says “there’s a fist,” not “Freddie made a fist.” We match each hand to the performer whose pose wrist is closest. Then there’s the suspect from my last entry: a thumbs-up that switches the elephant into a scripted circle and locks all of us out. A continuous signal that’s slightly wrong gives you a slightly wrong elephant. A discrete signal that’s wrong gives you a completely different behaviour.</p><h4>The gaps are signals too</h4><p>The sneakiest bug of the week wasn’t any of the three types. It was the absence of a signal. When the tracker lost a frame, our code read the missing value as “knee down,” and the next frame looked like a fresh knee lift. A seated test gave 8 jumps for 4 real raises. Holding the last known state through a dropped frame brought it back to 4 for 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DWt_3Wc1n-foOxaN53KqEQ.png" /><figcaption><em>Capture, signals, mapping, digital twin, result.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bLxVFDRFt6izEjgFcTCXcA.png" /><figcaption><em>Our version of that pipeline: perform, see, translate, play, with feedback back to the performers.</em></figcaption></figure><h3>What I’m taking forward</h3><p>Before this lecture, I thought of our tuning sessions as fixing numbers. Now I think of them as designing tolerance: how much wobble a person can have before the elephant reacts, how long a pose has to last before it counts, and what happens when the signal disappears. As Rohan is the driver, I also learned his numbers. His hand raise sits around 1.3, and my standing sway is ±0.16. That’s a strange thing to know about someone else’s body, and it’s exactly what this system needed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04a77a585976" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[W7 E1 — TDF DesComp]]></title>
            <link>https://medium.com/@cassiusp/w7-e1-tdf-descomp-6484dcceb050?source=rss-8cf63d0321cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/6484dcceb050</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[computation-design]]></category>
            <dc:creator><![CDATA[Cassius Palacio]]></dc:creator>
            <pubDate>Wed, 14 Oct 2026 18:39:49 GMT</pubDate>
            <atom:updated>2026-10-14T18:39:49.570Z</atom:updated>
            <content:encoded><![CDATA[<p>Week 7, Entry 1<br>Technology Design Foundations — Design Computation</p><h3>What the Digital Twins lecture showed me about our elephant, and about the three people driving it.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGp_jPhr1dAT9Xyw1joaiA.png" /><figcaption>Captured from Lecture Slides</figcaption></figure><p>This week’s lecture opened with that definition, and it stuck with me for the rest of the week. By that standard, our DigiPhant isn’t a twin of an elephant. No elephant is sending us data. The real-world counterpart our model reflects is the three of us: Rohan, Freddie and me, standing in a row in Wurster Hall, pretending to be one animal.</p><p>The brief says this up front (“you are not-a-quadruped, nor do you have a trunk”), but the lecture made me see it as a design condition rather than a joke. We are building a twin of a performance. The elephant is the interface.</p><h4>Five stages, one webcam</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKLwvpj0_LYA69JEXPRQQw.gif" /><figcaption><em>The five layers of a digital twin, from the lecture’s elephant conservation example.</em></figcaption></figure><p>The lecture broke a twin into five layers. Here is how ours lines up against them:</p><ol><li><strong>Data collection.</strong> One laptop webcam and MediaPipe Pose Landmarker. No collars, no drones, just 33 landmarks per body.</li><li><strong>Virtual modeling.</strong> The rigged elephant in Unity, with walk, run, turn and trunk joints.</li><li><strong>Live data integration.</strong> Every frame, each of us becomes six numbers (two hand heights, two foot lifts, lean and arm spread), sent to Unity over a local connection.</li><li><strong>Analysis and simulation.</strong> The obstacle course. This is where the elephant meets terrain, logs and boundaries, and where our movements turn into routes, collisions and near misses.</li><li><strong>Decisions and optimization.</strong> For us this layer points back at the humans. Every run told us something to change: a threshold, a role, where someone stands.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PwylYxRDSL9aTLtjkihF3A.png" /><figcaption><em>Observe, interpret, translate, simulate, test. The body-motion version of the workflow is basically our project.</em></figcaption></figure><h3>What the week actually looked like</h3><p>We started the week with a working rig from Saturday’s tuning session. On Monday at Wurster, Rohan’s note to the group chat was one line:</p><blockquote>“learning from using the one person commands — not jumping.”</blockquote><p>Controls that felt fine for one person fell apart once three of us were in frame. The same day he fixed reverse walking so backing up was as responsive as going forward.</p><p><strong>Tuesday was the idea explosion.</strong> We agreed to add inputs instead of swapping them: body, hands and maybe face, layered like a control switch rather than replacing what already worked. Freddie described it as</p><blockquote>“the body controls the legs, face controlling the trunk.”</blockquote><p>Then the ideas got bigger: a log the elephant picks up and jumps over, terrain, coins, a Temple Run-style course, Goat Simulator energy, and yes, a tutu. I admitted in the chat that I knew it was scope creep. Rohan’s response was the right one: give it a fixed amount of time and do as much as we can in that window.</p><p>Thursday was our first attempt at the supplied obstacle course, and Rohan made the call that shaped the rest of the project: record a run with the stable system first, then try the ambitious ideas. One stable build, one ambitious build.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-vOYzS19Z_-5vH4Z_DZwbA.jpeg" /><figcaption><em>Our formation for the first course attempt, Thursday. Three zones, one camera, P1 on the left raising a hand to walk.</em></figcaption></figure><h3>Zoning the Classroom</h3><p>Before any of that could work, we had to solve a more basic problem: knowing who was who. The starter tracker followed people by their movement, so when two of us shifted or got close, our identities swapped and the elephant’s legs suddenly belonged to the wrong person. So we proposed zoning the room itself, the way you’d block a stage. I rewrote the tracker so the camera image is split into equal vertical strips: P1, P2 and P3 are simply whoever stands in the left, middle and right strip. Each of us got a taped X on the floor. A size check ignores anyone much bigger or smaller than the performers, like whoever is sitting right in front of the laptop. The boundaries are drawn in red on the camera preview so you can see your zone while you play. Later in the week, I added messages that say why the tracker is waiting: an empty zone, two people in one zone, or someone out of frame.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*RPJyz7Qruhd30EpXCM24iQ.jpeg" /><figcaption><em>The red zone lines on our camera preview. Where you stand decides whether you’re P1, P2 or P3.</em></figcaption></figure><p>The code lives in ZoneTracker in <a href="https://github.com/cassiusp-beep/Berkeley_DesComp_DigitalTwin_TeamPaladin/blob/main/Paladin_Digiphant/Paladin_Digiphant/Tracking/bridge.py">Tracking/bridge.py</a>. It went in with <a href="https://github.com/cassiusp-beep/Berkeley_DesComp_DigitalTwin_TeamPaladin/commit/cf81056b">commit cf81056</a>, &quot;Track the camera tracker in-repo and assign performers by fixed zones,&quot; and was merged as <a href="https://github.com/cassiusp-beep/Berkeley_DesComp_DigitalTwin_TeamPaladin/pull/3">pull request #3</a>.</p><p>What stayed with me is how quickly the idea spread beyond our team. Zoning the space showed up across the class as a way to get the camera to pick people up reliably. It reminded me that the physical setup of a digital twin is part of its design: tape on a classroom floor did as much for tracking quality as any line of code.</p><h3>When the twin stops listening</h3><p>The most useful failure of the week came right after that first attempt: the elephant stopped responding to us. My agent and I went through the history and found a likely suspect in the stable build. A thumbs-up gesture made the elephant walk a scripted circle, and while that mode ran it ignored all three performers. It could only start after a neutral open palm had been saved, so we never fully confirmed it as the cause. But it showed us a risk we hadn’t designed for.</p><p>I keep coming back to this one because it breaks the lecture’s definition in a very literal way. A twin that stops reflecting its source isn’t a twin anymore; it’s an animation.</p><blockquote><em>We now treat</em> “the elephant must always be listening to us” <em>as a rule.</em></blockquote><p>That’s why gestures have to be re-armed with an open palm, and why lean steering stays the default.</p><p>The second lesson was about trust in our own data. A seated test produced 8 jumps for 4 deliberate raises. Every time the tracker lost a frame and found it again, the code read it as a new knee lift. The fix was small (a missing frame keeps the last state), but it changed how I think about live data. The gaps in the stream are part of the data too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gWTNTSSd93jP_yW3yTCJpw.jpeg" /><figcaption><em>Our first whiteboard: three persons in the same frame, divide the elephant into three parts of essential movement, assign three different poses.</em></figcaption></figure><h3>Interrogating the proxy</h3><p>The brief’s last operation is “interrogate”: what assumptions and distortions do human proxies bring in? Here is where I’ve landed so far.</p><ul><li><strong>Gait becomes a throttle.</strong> A real elephant’s speed comes from four legs in sequence. Ours comes from my left hand going up and down. The elephant walks convincingly, but our data says nothing true about elephant gait.</li><li><strong>The trunk becomes a squat.</strong> Freddie’s reach is a squat with his right hand low. The motion is human, so it reflects how a person reaches for something, not how a trunk does.</li><li><strong>Three minds, one animal.</strong> The most honest data our simulation generates is about coordination: how early I have to call a turn, how long Rohan takes to slow down before Freddie can grab. That is real data, but it is data about us.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E-VrNMOY_xOAbAUgcOUdoQ.png" /><figcaption><em>The lecture’s elephant conservation twin uses real collars, terrain and weather data. Ours swaps the animal for three performers.</em></figcaption></figure><p>That difference is what I want to keep thinking about. A conservation twin gets more accurate as the sensors improve. Ours gets more accurate as the three of us practice together. Next week is about making that coordination visible, and making sure the elephant never stops listening.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6484dcceb050" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab №6: Rabbid Heartbeats — TUI]]></title>
            <link>https://medium.com/@cassiusp/lab-6-rabbid-heartbeats-tui-5389e50a5c80?source=rss-8cf63d0321cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/5389e50a5c80</guid>
            <category><![CDATA[tangible-user-interface]]></category>
            <dc:creator><![CDATA[Cassius Palacio]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 18:32:08 GMT</pubDate>
            <atom:updated>2026-10-12T23:36:41.158Z</atom:updated>
            <content:encoded><![CDATA[<p>Cassius Palacio. Professor Kimiko Ryokai. Tangible User Interfaces, Fall 2026</p><h3>Inspiration</h3><p>I wanted to build something where the hand matters more than the screen.</p><p>CPR is one of the few skills that lives almost entirely in the body. You count out loud, you lock your elbows, you push to a rhythm, and you get almost no feedback until something changes. A training mannequin is a tangible interface in the purest sense: a heart that beats, and a set of rules you learn by doing.</p><p>I have never learned how to do CPR on a living thing smaller than a human. From a small creature’s point of view, we are giant goliaths, celestials leaning over them with hands the size of their whole body. Saving one would take a completely different kind of care. <em>It is also an excuse to indulge the kid who grew up watching Eddie Murphy talk to animals in</em> Dr. Dolittle, <em>and who still wants to be the one who understands them. </em><strong>I wanted the patient’s condition to be something you hear and feel first, and read second.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*Dg8Nu4DkJJ6MKR5NNQnAaw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pxUwyUzmQ-RckVp730jx8A.jpeg" /><figcaption>Scene still from Dr. Dolittle showing Dr. Dolittle doing RAT CPR</figcaption></figure><h3>Description</h3><p>The final piece is a CPR heart simulator on a real Arduino, paired with a browser monitor over Web Serial. The live monitor is at <strong>cpr-monitor.vercel.app</strong>.</p><p>The system has two inputs and three outputs:</p><ul><li><strong>Force sensitive resistor:</strong> the chest. Each press is a compression.</li><li><strong>Potentiometer:</strong> the defibrillator. Turn it to max to charge, hold, then snap it to min to shock.</li><li><strong>Vibration motor:</strong> the heartbeat, made physical with an off-center cardboard disk so it thumps instead of buzzes.</li><li><strong>Piezo: </strong>the monitor beep and lub-dub heart sounds.</li><li><strong>LED:</strong> a rapid blink while the patient is dying, a lub-dub pulse once stable.</li></ul><p>The patient, a jack rabbit, starts in ventricular fibrillation with low HP. Steady compressions raise HP, and a pace of 70 to 140 per minute earns a bonus. At HP 20 or above, you can charge and shock to restore a heartbeat, and the heart recovers to stable at HP 100. Stop compressing and HP decays to a flatline. Compress again and the heart falls back into V-fib.</p><p><strong>The defibrillator works at any time, and every shock has consequences.</strong> Shock V-fib too early and the patient loses HP. Shock a beating heart and it falls back into V-fib. Shock a flatline and the patient dies, permanently, until a restart.</p><h4>Phase 1: The First Sketch</h4><p>The first version worked, but only on paper. Output went to a text serial monitor, a press only counted above an FSR reading of 300, the motor gave a short buzz per beat, and the defibrillator was locked unless the patient was in V-fib.</p><p>Getting the motor running at all meant fixing the driver circuit in Tinkercad first. The NPN transistor sat on the breadboard unconnected, so I wired it as a low-side switch: emitter to ground, collector to the motor, base to pin 6 through a 1kΩ resistor, with a 1N4001 flyback diode across the motor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LbyJ96r05PXH0LkNYkWsFw.png" /><figcaption>Screenshot of the TinkerCAD</figcaption></figure><h4>Phase 2: Making the Motor Thump</h4><p>A buzz is not a heartbeat. The short pulses read as a phone notification, not a body.</p><p>I glued an off-center cardboard disk to the motor shaft and rewrote the pattern as a lub-dub: a full-power kick, a stop, then a softer kick. <strong>The thump lives in the stops, not the spinning.</strong> Silence between kicks is what lets the weight of the disk land.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wH6FrpGDMJI4lLtDLJ1nJg.png" /><figcaption>Screenshot of section of Rhino Model of designing an apparatus around the motor and a case for the off-center cardboard disk.</figcaption></figure><h4>Phase 3: Calibrating the Chest</h4><p>The FSR needed far too hard a press to register, which is the opposite of what a training tool should ask of your hands. I replaced the fixed threshold with startup auto-calibration: the sketch reads the resting value, and a push counts at 60 above rest. I also added smoothing so one compression does not double-count.</p><h4>Phase 4: Cleaning Up the Monitor</h4><p>The serial monitor became readable: aligned columns, a live press gauge, and boxed event messages for shocks, flatlines and recoveries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*fE6CyLUWgso6ftIEAqhdJw.gif" /><figcaption>Analog based monitor modeled in TinkerCAD</figcaption></figure><h4>Phase 5: A Stronger Heartbeat</h4><p>The heartbeat still felt faint in the hand. I lengthened the kicks to 160 ms and about 105 ms at full power, slowed the heart rate range to 64 to 110 bpm so each beat had room, and added live tuning with the + and − keys so I could adjust it without re-uploading.</p><h4>Phase 6: Letting the Defibrillator Be Wrong</h4><p>In the original sketch, the defib simply did nothing outside V-fib. That made it safe, and it made it meaningless. I changed it to work at any time, with real consequences for using it badly. <strong>A locked-out action teaches nothing; a risky one teaches judgment.</strong></p><h4>Phase 7: The Browser Monitor</h4><p>Finally, I replaced the text view with a browser visualization over Web Serial in Chrome. It shows:</p><ul><li>a large BPM readout colored by rhythm</li><li>a next-step prompt telling you what to do now</li><li>an HP bar and a scrolling ECG trace</li><li>press and defib meters</li><li>full-screen CLEAR!, Don’t shock, and Patient has died screens</li><li>a demo mode for presenting without the board</li></ul><p>The layout follows my Lab 05 page, with a high-contrast palette of black and white plus green, yellow, red and cyan, so rhythm and danger read from across a room.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*QnAO-wF6VsV_faNs.gif" /><figcaption>Live look at the Browser Monitor.</figcaption></figure><h3>Designing the Interaction</h3><p>Two decisions shaped this lab more than any line of code.</p><p><strong>The first was treating the heartbeat as something felt, not displayed.</strong> Every iteration of the motor (the disk, the lub-dub, the longer kicks, the slower rate) was about making the hand under the device know the patient’s state before the eyes did. The piezo and LED repeat the same rhythm, so the heart speaks in three channels at once: touch, sound and light.</p><p><strong>The second was giving the defibrillator consequences instead of permissions.</strong> The potentiometer gesture (crank to max, hold, snap to min) already has weight to it. Locking it out removed that weight. Allowing it at any time, with a cost for misuse, turns the shock into a decision you have to read the monitor to make. <em>The interface does not stop you from making a mistake; it shows you what the mistake did.</em></p><p>The browser monitor exists to support that decision, not replace it. The next-step prompt and the full-screen Don’t shock warning are there so the screen answers one question: what should my hands do now?</p><h3>Testing and Open Issues</h3><ul><li><strong>Heartbeat on hardware:</strong> The 160 ms lub-dub does thump through the disk.</li><li><strong>FSR calibration:</strong> The +60 threshold does feel right. Sensitive enough to not break the animals’ chest, in real life.</li><li><strong>Web monitor connection:</strong> the Connect Arduino port picker vanished after about 2 seconds on first try, likely because the page was open inside VS Code’s preview rather than Chrome, which is where Web Serial is supported. This now works again after opening cpr-monitor.vercel.app in Chrome.</li></ul><h3>Final Code</h3><h4><strong>Arduino (LAB-06.ino)</strong></h4><pre>// =====================================================<br>//  CPR Heart Simulator - 06 TUI Lab<br>//  FSR (A0)  = chest compressions (auto-calibrated at startup)<br>//              tip: a bigger divider resistor (47k-100k instead<br>//              of 10k) makes the FSR even more sensitive<br>//  Pot (A1)  = defibrillator: turn to MAX to charge,<br>//              then snap back to MIN to shock (&quot;CLEAR!&quot;)<br>//  Motor (6) = heartbeat thump, off-center cardboard disk<br>//              (via NPN transistor)<br>//  Piezo (8) = monitor beep + lub-dub heart sounds<br>//  LED   (9) = rapid blink = dying, lub-dub pulse = stable<br>//  Serial    = scrolling heart monitor (115200 baud)<br>//              r = restart,  h = help,  c = recalibrate FSR<br>//              v = visual mode (data for index.html), t = text mode<br>//  Visual    = open index.html in Chrome, click Connect Arduino<br>// =====================================================<br><br>// ---------- Pins ----------<br>const int FSR_PIN   = A0;<br>const int POT_PIN   = A1;<br>const int MOTOR_PIN = 6;<br>const int PIEZO_PIN = 8;<br>const int LED_PIN   = 9;<br><br>// ---------- Tuning (easy mode) ----------<br>const int PRESS_DELTA       = 60;    // rise above resting FSR that counts as a push<br>const int RELEASE_DELTA     = 25;    // drop below this (above resting) before the next push counts<br>const int CHARGED_LEVEL     = 950;   // pot reading that counts as &quot;at MAX&quot;<br>const int DISCHARGE_LEVEL   = 150;   // pot reading that fires the shock<br>const unsigned long CHARGE_TIME_MS = 1000;  // hold at max this long to charge<br>const unsigned long FIRE_WINDOW_MS = 4000;  // time allowed to bring the pot down<br>const unsigned long MONITOR_MS     = 200;   // one monitor line every 200 ms<br>const unsigned long CPR_GRACE_MS   = 3000;  // pause allowed between pushes<br>const float SHOCK_READY_HP = 20;     // HP needed for a shock to work<br>const float DECAY_PER_SEC  = 0.75;   // HP lost per second with no CPR<br>const float GOOD_MIN = 70;           // &quot;good pace&quot; window (pushes/min)<br>const float GOOD_MAX = 140;<br>const float START_HP = 12;<br>const float PULSE_SHOCK_HP = 15;     // shocking a beating heart throws it into V-fib at this HP<br>const float BAD_SHOCK_DAMAGE = 10;   // HP lost when shocking V-fib before HP 20<br><br>// ---------- Heartbeat feel (off-center disk: kick hard, then let it stop) ----------<br>// lubMs is live-tunable: type + or - in the Serial Monitor<br>int lubMs = 160;                     // first (strong) kick length<br>const int KICK_MIN = 60, KICK_MAX = 240, KICK_STEP = 20;<br>const int BEEP_FREQ = 1000; const int BEEP_MS  = 50;<br>const int LUB_FREQ  = 140;  const int DUB_FREQ = 180;<br><br>// ---------- Serial layout ----------<br>const int HEADER_EVERY = 20;         // reprint column headers every N lines<br>const unsigned long DATA_MS = 50;    // visual mode: one data line every 50 ms<br><br>// ---------- Patient state ----------<br>enum Rhythm { VFIB, FLATLINE, BEATING, DEAD };<br>Rhythm rhythm = VFIB;<br>float health = START_HP;     // 0 = dead, 100 = fully stable<br>int bpm = 0;<br>bool readyAnnounced = false;<br>bool stableAnnounced = false;<br><br>// ---------- CPR tracking ----------<br>int fsrBaseline = 0;<br>float fsrSmooth = 0;<br>bool pressed = false;<br>unsigned long lastCompression = 0;<br>float cprRate = 0;<br>const char* cprTag = &quot;&quot;;<br>unsigned long cprTagUntil = 0;<br><br>// ---------- Defibrillator ----------<br>enum Defib { IDLE, CHARGING, CHARGED };<br>Defib defib = IDLE;<br>unsigned long chargeStart = 0;<br>unsigned long leftMaxAt = 0;<br><br>// ---------- Timing ----------<br>unsigned long lastUpdate = 0;<br>unsigned long lastBeat = 0;<br>unsigned long lastFlicker = 0;<br>unsigned long lastPrint = 0;<br>bool ledState = false;<br>int currentFreq = -1;<br>bool beatFlag = false;<br>bool lastWasSpike = false;<br>bool vfibMotorOn = false;<br>unsigned long vfibToggleAt = 0;<br>unsigned long vfibDuration = 0;<br>int linesSinceHeader = 0;<br>bool headerDue = true;<br>// Visual mode (index.html): instead of the text table, send<br>//   D,rhythm,bpm,hp,press%,defib,charge%,cprRate   every DATA_MS<br>//   B = heartbeat   P,rate = compression   Z = shock   M,text = message<br>// rhythm: 0 V-fib, 1 flatline, 2 beating, 3 dead   defib: 0 idle, 1 charging, 2 charged<br>bool visualMode = false;<br><br>void setup() {<br>  pinMode(MOTOR_PIN, OUTPUT);<br>  pinMode(PIEZO_PIN, OUTPUT);<br>  pinMode(LED_PIN, OUTPUT);<br>  Serial.begin(115200);<br>  randomSeed(analogRead(A2));<br>  calibrateFSR();<br>  printHelp();<br>  lastUpdate = millis();<br>}<br><br>void loop() {<br>  unsigned long now = millis();<br>  float dt = (now - lastUpdate) / 1000.0;<br>  lastUpdate = now;<br><br>  handleSerial();<br><br>  fsrSmooth = fsrSmooth * 0.6 + analogRead(FSR_PIN) * 0.4;<br>  int pot = analogRead(POT_PIN);<br><br>  handleCPR((int)fsrSmooth, now);<br>  handleDefib(pot, now);<br>  updateHealth(dt, now);<br>  drawOutputs(now);<br>  drawMonitor(now);<br>}<br><br>// ---------------- Help / restart ----------------<br>void printRule(char c) {<br>  for (int i = 0; i &lt; 52; i++) Serial.print(c);<br>  Serial.println();<br>}<br><br>void printHelp() {<br>  if (visualMode) { announce(&quot;New patient in V-FIB. Start CPR&quot;); return; }<br>  Serial.println();<br>  printRule(&#39;=&#39;);<br>  Serial.println(F(&quot;          ER HEART MONITOR  -  BED 06&quot;));<br>  printRule(&#39;=&#39;);<br>  Serial.println(F(&quot;  Patient is in CARDIAC ARREST (V-fib)!&quot;));<br>  printRule(&#39;-&#39;);<br>  Serial.println(F(&quot;  1. CPR: press the FSR in a steady rhythm&quot;));<br>  Serial.println(F(&quot;     (PRESS gauge shows how hard you push)&quot;));<br>  Serial.println(F(&quot;     until HEALTH reaches 20&quot;));<br>  Serial.println(F(&quot;  2. Turn the pot to MAX and hold it there&quot;));<br>  Serial.println(F(&quot;  3. When it says CLEAR, turn the pot to MIN&quot;));<br>  Serial.println(F(&quot;  4. Hands off while the heart recovers&quot;));<br>  Serial.println(F(&quot;  !! You can shock ANY time, but a bad shock&quot;));<br>  Serial.println(F(&quot;     hurts: shocking a pulse causes V-fib,&quot;));<br>  Serial.println(F(&quot;     shocking a flatline kills the patient&quot;));<br>  printRule(&#39;-&#39;);<br>  Serial.println(F(&quot;  Commands (type + Send):&quot;));<br>  Serial.println(F(&quot;    r = restart   h = help   c = recalibrate FSR&quot;));<br>  Serial.println(F(&quot;    + / - = stronger / weaker heartbeat kick&quot;));<br>  Serial.println(F(&quot;  The NEXT STEP column tells you what to do&quot;));<br>  printRule(&#39;=&#39;);<br>  Serial.println();<br>  headerDue = true;<br>}<br><br>void calibrateFSR() {<br>  Serial.println();<br>  if (!visualMode) Serial.println(F(&quot;Calibrating FSR... hands off&quot;));<br>  long sum = 0;<br>  for (int i = 0; i &lt; 32; i++) {<br>    sum += analogRead(FSR_PIN);<br>    delay(5);<br>  }<br>  fsrBaseline = sum / 32;<br>  fsrSmooth = fsrBaseline;<br>  pressed = false;<br>  if (visualMode) Serial.print(F(&quot;M,&quot;));<br>  Serial.print(F(&quot;FSR calibrated, resting level: &quot;));<br>  Serial.println(fsrBaseline);<br>  headerDue = true;<br>}<br><br>void resetPatient() {<br>  rhythm = VFIB;<br>  health = START_HP;<br>  defib = IDLE;<br>  cprRate = 0;<br>  lastCompression = 0;<br>  readyAnnounced = false;<br>  stableAnnounced = false;<br>  printHelp();<br>}<br><br>void handleSerial() {<br>  while (Serial.available()) {<br>    char c = Serial.read();<br>    if (c == &#39;r&#39; || c == &#39;R&#39;) resetPatient();<br>    else if (c == &#39;h&#39; || c == &#39;H&#39;) printHelp();<br>    else if (c == &#39;c&#39; || c == &#39;C&#39;) calibrateFSR();<br>    else if (c == &#39;v&#39; || c == &#39;V&#39;) { visualMode = true; announce(&quot;Visual monitor connected&quot;); }<br>    else if (c == &#39;t&#39; || c == &#39;T&#39;) { visualMode = false; printHelp(); }<br>    else if (c == &#39;+&#39; || c == &#39;-&#39;) {<br>      lubMs = constrain(lubMs + (c == &#39;+&#39; ? KICK_STEP : -KICK_STEP), KICK_MIN, KICK_MAX);<br>      if (visualMode) Serial.print(F(&quot;M,&quot;));<br>      Serial.print(F(&quot;Heartbeat kick: &quot;));<br>      Serial.print(lubMs);<br>      Serial.println(F(&quot; ms&quot;));<br>    }<br>  }<br>}<br><br>// ---------------- Event messages ----------------<br>void announce(const char* msg) {<br>  if (visualMode) {<br>    Serial.print(F(&quot;M,&quot;));<br>    Serial.println(msg);<br>    return;<br>  }<br>  Serial.println();<br>  printRule(&#39;=&#39;);<br>  Serial.print(F(&quot;  &gt;&gt; &quot;));<br>  Serial.println(msg);<br>  printRule(&#39;=&#39;);<br>  Serial.println();<br>  headerDue = true;<br>}<br><br>// ---------------- CPR ----------------<br>void handleCPR(int fsr, unsigned long now) {<br>  int pressLevel   = min(fsrBaseline + PRESS_DELTA, 1000);<br>  int releaseLevel = min(fsrBaseline + RELEASE_DELTA, pressLevel - 10);<br><br>  if (!pressed &amp;&amp; fsr &gt; pressLevel) {<br>    pressed = true;<br>    unsigned long gap = now - lastCompression;<br>    if (lastCompression &gt; 0 &amp;&amp; gap &gt; 200 &amp;&amp; gap &lt; CPR_GRACE_MS) {<br>      float rate = 60000.0 / gap;<br>      cprRate = (cprRate == 0) ? rate : cprRate * 0.6 + rate * 0.4;<br>    }<br>    lastCompression = now;<br><br>    float gain;<br>    if (cprRate == 0)                            { gain = 2.0; cprTag = &quot;PUSH  keep going&quot;; }<br>    else if (cprRate &gt;= GOOD_MIN &amp;&amp; cprRate &lt;= GOOD_MAX)<br>                                                 { gain = 3.5; cprTag = &quot;PUSH  GOOD PACE&quot;; }<br>    else if (cprRate &gt; GOOD_MAX)                 { gain = 2.0; cprTag = &quot;PUSH  a bit slower&quot;; }<br>    else                                         { gain = 2.0; cprTag = &quot;PUSH  a bit faster&quot;; }<br>    cprTagUntil = now + 600;<br>    if (visualMode) {<br>      Serial.print(F(&quot;P,&quot;));<br>      Serial.println((int)cprRate);<br>    }<br><br>    if (rhythm == BEATING) {<br>      cprTag = &quot;Pulse is back, no CPR needed&quot;;<br>    } else if (rhythm == DEAD) {<br>      cprTag = &quot;Patient has died. r + Send to restart&quot;;<br>    } else {<br>      health = min(health + gain, 40.0f);   // CPR alone can&#39;t restart the heart<br>    }<br>  }<br>  if (pressed &amp;&amp; fsr &lt; releaseLevel) pressed = false;<br><br>  if (now - lastCompression &gt; CPR_GRACE_MS) cprRate = 0;<br>}<br><br>// ---------------- Defibrillator ----------------<br>void handleDefib(int pot, unsigned long now) {<br>  switch (defib) {<br>    case IDLE:<br>      if (pot &gt;= CHARGED_LEVEL &amp;&amp; rhythm != DEAD) {   // shock allowed any time, right or wrong<br>        defib = CHARGING;<br>        chargeStart = now;<br>      }<br>      break;<br><br>    case CHARGING:<br>      if (pot &lt; CHARGED_LEVEL) {<br>        defib = IDLE;<br>        announce(&quot;Charge cancelled. Keep the pot at MAX until CLEAR&quot;);<br>      } else if (now - chargeStart &gt;= CHARGE_TIME_MS) {<br>        defib = CHARGED;<br>        leftMaxAt = now;<br>        if (rhythm == BEATING)<br>          announce(&quot;CHARGED. WARNING: patient has a pulse! Shocking now causes V-fib&quot;);<br>        else if (rhythm == FLATLINE)<br>          announce(&quot;CHARGED. WARNING: shocking a flatline will kill the patient&quot;);<br>        else if (health &gt;= SHOCK_READY_HP)<br>          announce(&quot;CHARGED!  EVERYBODY CLEAR!  (turn pot to MIN)&quot;);<br>        else<br>          announce(&quot;CHARGED. HP under 20: shocking now hurts. Hold MAX + do CPR&quot;);<br>      }<br>      break;<br><br>    case CHARGED:<br>      if (pot &gt;= CHARGED_LEVEL) {<br>        leftMaxAt = now;                     // holding at max keeps the charge<br>      } else if (pot &lt;= DISCHARGE_LEVEL) {<br>        shock();<br>      } else if (now - leftMaxAt &gt; FIRE_WINDOW_MS) {<br>        defib = IDLE;<br>        announce(&quot;Charge lost. Turn the pot all the way to MIN next time&quot;);<br>      }<br>      break;<br>  }<br>}<br><br>void shock() {<br>  defib = IDLE;<br>  if (visualMode) {<br>    Serial.println(&#39;Z&#39;);<br>  } else {<br>    Serial.println();<br>    Serial.println(F(&quot;   ////////////  ZAP!  SHOCK DELIVERED  \\\\\\\\\\\\\\\\\\\\\\\\&quot;));<br>  }<br>  setTone(150);<br>  digitalWrite(LED_PIN, HIGH);<br>  analogWrite(MOTOR_PIN, 255);<br>  delay(400);<br>  analogWrite(MOTOR_PIN, 0);<br>  digitalWrite(LED_PIN, LOW);<br>  setTone(0);<br>  delay(300);<br><br>  if (rhythm == VFIB &amp;&amp; health &gt;= SHOCK_READY_HP) {<br>    rhythm = BEATING;<br>    health = 50;<br>    lastBeat = millis();<br>    announce(&quot;HEARTBEAT RESTORED!  Hands off, patient is recovering&quot;);<br>  } else if (rhythm == VFIB) {<br>    health -= BAD_SHOCK_DAMAGE;<br>    if (health &lt;= 0) killPatient(&quot;Shocked too early, the heart gave out&quot;);<br>    else announce(&quot;Shock failed: HP was under 20 and the heart took damage. More CPR!&quot;);<br>  } else if (rhythm == BEATING) {<br>    rhythm = VFIB;<br>    health = PULSE_SHOCK_HP;<br>    readyAnnounced = false;<br>    stableAnnounced = false;<br>    announce(&quot;You shocked a beating heart!  It&#39;s in V-FIB again. Start CPR!&quot;);<br>  } else {<br>    killPatient(&quot;Shocked a flatline. There was nothing to restart&quot;);<br>  }<br>}<br><br>void killPatient(const char* why) {<br>  rhythm = DEAD;<br>  health = 0;<br>  defib = IDLE;<br>  announce(why);<br>  announce(&quot;PATIENT HAS DIED.  Type r + Send to try again&quot;);<br>}<br><br>// ---------------- Health ----------------<br>void updateHealth(float dt, unsigned long now) {<br>  if (rhythm == DEAD) return;<br>  if (rhythm == BEATING) {<br>    health = min(health + 2.0 * dt, 100.0);<br>    if (health &gt;= 100 &amp;&amp; !stableAnnounced) {<br>      stableAnnounced = true;<br>      announce(&quot;PATIENT STABLE.  YOU SAVED THEM!  (type r + Send to play again)&quot;);<br>    }<br>    return;<br>  }<br><br>  bool doingCPR = (now - lastCompression &lt; CPR_GRACE_MS);<br>  if (!doingCPR) health -= DECAY_PER_SEC * dt;<br><br>  if (health &lt;= 0) {<br>    health = 0;<br>    if (rhythm != FLATLINE) {<br>      rhythm = FLATLINE;<br>      defib = IDLE;<br>      readyAnnounced = false;<br>      announce(&quot;FLATLINE!  Keep doing CPR to bring back V-fib&quot;);<br>    }<br>  } else if (rhythm == FLATLINE &amp;&amp; health &gt; 10) {<br>    rhythm = VFIB;<br>    announce(&quot;V-fib returned. Keep up CPR to HP 20, then shock&quot;);<br>  }<br><br>  if (rhythm == VFIB) {<br>    if (health &gt;= SHOCK_READY_HP &amp;&amp; !readyAnnounced) {<br>      readyAnnounced = true;<br>      if (defib == CHARGED) announce(&quot;HP 20+!  CLEAR!  Turn the pot to MIN now&quot;);<br>      else announce(&quot;HP 20+!  Ready to shock: turn the pot to MAX&quot;);<br>    } else if (health &lt; SHOCK_READY_HP - 2) {<br>      readyAnnounced = false;<br>    }<br>  }<br>}<br><br>// ---------------- Physical outputs ----------------<br>void drawOutputs(unsigned long now) {<br>  int freq = 0;<br>  int motor = 0;<br>  bool led = false;<br><br>  if (rhythm == BEATING) {<br>    bpm = map((int)health, 50, 100, 110, 64);<br>    unsigned long interval = 60000UL / bpm;<br>    if (now - lastBeat &gt;= interval) {<br>      lastBeat = now;<br>      beatFlag = true;<br>      if (visualMode) Serial.println(&#39;B&#39;);<br>    }<br>    // lub-dub: long full kick, stop, shorter full kick, stop<br>    // (the disk needs time to spin up; the stops make the thump)<br>    unsigned long p = now - lastBeat;<br>    int dubStart = lubMs + 90;<br>    int dubMs = lubMs * 2 / 3;<br>    bool lub = (p &lt; (unsigned long)lubMs);<br>    bool dub = (p &gt;= (unsigned long)dubStart &amp;&amp; p &lt; (unsigned long)(dubStart + dubMs));<br>    if (lub || dub) motor = 255;<br>    led = lub || dub;<br>    if (p &lt; BEEP_MS)  freq = BEEP_FREQ;      // monitor beep<br>    else if (lub)     freq = LUB_FREQ;<br>    else if (dub)     freq = DUB_FREQ;<br>  }<br>  else if (rhythm == VFIB) {<br>    bpm = 0;<br>    if (now - lastFlicker &gt; 80) {<br>      lastFlicker = now;<br>      ledState = !ledState;<br>    }<br>    // irregular short bursts so the disk quivers instead of spinning<br>    if (now - vfibToggleAt &gt;= vfibDuration) {<br>      vfibToggleAt = now;<br>      vfibMotorOn = !vfibMotorOn;<br>      vfibDuration = vfibMotorOn ? random(30, 71) : random(40, 121);<br>    }<br>    led = ledState;<br>    motor = vfibMotorOn ? 255 : 0;<br>    unsigned long c = now % 1000;<br>    if (c &lt; 120 || (c &gt;= 200 &amp;&amp; c &lt; 320) || (c &gt;= 400 &amp;&amp; c &lt; 520)) freq = 960;<br>  }<br>  else if (rhythm == FLATLINE) {<br>    bpm = 0;<br>    if (now - lastFlicker &gt; 150) {<br>      lastFlicker = now;<br>      ledState = !ledState;<br>    }<br>    led = ledState;<br>    freq = 1000;<br>  }<br>  else {                                     // DEAD: steady flatline tone, everything still<br>    bpm = 0;<br>    freq = 1000;<br>  }<br><br>  if (defib == CHARGING) {<br>    freq = map(now - chargeStart, 0, CHARGE_TIME_MS, 400, 2000);<br>  } else if (defib == CHARGED) {<br>    freq = ((now / 100) % 2) ? 2200 : 0;<br>  }<br><br>  digitalWrite(LED_PIN, led ? HIGH : LOW);<br>  analogWrite(MOTOR_PIN, motor);<br>  setTone(freq);<br>}<br><br>void setTone(int f) {<br>  if (f == currentFreq) return;<br>  currentFreq = f;<br>  if (f &gt; 0) tone(PIEZO_PIN, f);<br>  else noTone(PIEZO_PIN);<br>}<br><br>// ---------------- Serial heart monitor ----------------<br>float ecgValue(unsigned long now) {<br>  if (rhythm == BEATING) {<br>    if (beatFlag)     { beatFlag = false; lastWasSpike = true; return 1.0; }<br>    if (lastWasSpike) { lastWasSpike = false; return -0.4; }<br>    unsigned long p = now - lastBeat;<br>    if (p &gt;= 200 &amp;&amp; p &lt; 400) return 0.25;<br>    return 0;<br>  }<br>  if (rhythm == VFIB) {<br>    return 0.45 * sin(now * 0.02) + random(-35, 36) / 100.0;<br>  }<br>  return 0;<br>}<br><br>void printHint() {<br>  if (rhythm == BEATING) {<br>    if (health &lt; 100) Serial.print(F(&quot;Recovering... hands off&quot;));<br>    else              Serial.print(F(&quot;STABLE  (r + Send = restart)&quot;));<br>  } else if (rhythm == DEAD) {<br>    Serial.print(F(&quot;PATIENT DIED  (r + Send = restart)&quot;));<br>  } else if (rhythm == FLATLINE) {<br>    Serial.print(F(&quot;NEXT: push the FSR (CPR)&quot;));<br>  } else if (health &lt; SHOCK_READY_HP) {<br>    Serial.print(F(&quot;NEXT: CPR to HP 20 (need &quot;));<br>    Serial.print((int)(SHOCK_READY_HP - health + 0.99));<br>    Serial.print(F(&quot; more)&quot;));<br>  } else {<br>    Serial.print(F(&quot;NEXT: turn pot to MAX&quot;));<br>  }<br>}<br><br>// print text, then pad with spaces to a fixed column width<br>void printCol(const char* text, int width) {<br>  Serial.print(text);<br>  for (int i = strlen(text); i &lt; width; i++) Serial.print(&#39; &#39;);<br>}<br><br>void printDashes(int n, int width) {<br>  for (int i = 0; i &lt; width; i++) Serial.print(i &lt; n ? &#39;-&#39; : &#39; &#39;);<br>}<br><br>void printHeader() {<br>  printCol(&quot;RHYTHM&quot;, 10); printCol(&quot;HR&quot;, 5); printCol(&quot;HEALTH&quot;, 18);<br>  printCol(&quot;ECG&quot;, 35);    printCol(&quot;PRESS&quot;, 12);<br>  Serial.println(F(&quot;NEXT STEP&quot;));<br>  printDashes(8, 10); printDashes(3, 5); printDashes(16, 18);<br>  printDashes(33, 35); printDashes(10, 12);<br>  Serial.println(F(&quot;---------&quot;));<br>  headerDue = false;<br>  linesSinceHeader = 0;<br>}<br><br>void sendData(unsigned long now) {<br>  int press = constrain(map((int)fsrSmooth - fsrBaseline, 0, PRESS_DELTA * 3, 0, 100), 0, 100);<br>  int charge = 0;<br>  if (defib == CHARGING) charge = constrain(map(now - chargeStart, 0, CHARGE_TIME_MS, 0, 100), 0, 100);<br>  else if (defib == CHARGED) charge = 100;<br>  Serial.print(F(&quot;D,&quot;));<br>  Serial.print(rhythm);        Serial.print(&#39;,&#39;);<br>  Serial.print(bpm);           Serial.print(&#39;,&#39;);<br>  Serial.print((int)health);   Serial.print(&#39;,&#39;);<br>  Serial.print(press);         Serial.print(&#39;,&#39;);<br>  Serial.print(defib);         Serial.print(&#39;,&#39;);<br>  Serial.print(charge);        Serial.print(&#39;,&#39;);<br>  Serial.println((int)cprRate);<br>}<br><br>void drawMonitor(unsigned long now) {<br>  if (visualMode) {<br>    if (now - lastPrint &gt;= DATA_MS) { lastPrint = now; sendData(now); }<br>    return;<br>  }<br>  if (now - lastPrint &lt; MONITOR_MS) return;<br>  lastPrint = now;<br><br>  if (headerDue || linesSinceHeader &gt;= HEADER_EVERY) printHeader();<br>  linesSinceHeader++;<br><br>  // rhythm (10)<br>  if (rhythm == BEATING)   printCol(&quot;SINUS&quot;, 10);<br>  else if (rhythm == VFIB) printCol(&quot;V-FIB&quot;, 10);<br>  else if (rhythm == DEAD) printCol(&quot;DECEASED&quot;, 10);<br>  else                     printCol(&quot;ASYSTOLE&quot;, 10);<br><br>  // heart rate (5)<br>  if (rhythm == BEATING) {<br>    if (bpm &lt; 100) Serial.print(&#39; &#39;);<br>    Serial.print(bpm);<br>  } else if (rhythm == VFIB) {<br>    Serial.print(F(&quot;???&quot;));<br>  } else {<br>    Serial.print(F(&quot;  0&quot;));<br>  }<br>  Serial.print(F(&quot;  &quot;));<br><br>  // health bar plus number (18)<br>  Serial.print(&#39;[&#39;);<br>  int bars = (int)(health / 10);<br>  for (int i = 0; i &lt; 10; i++) Serial.print(i &lt; bars ? &#39;#&#39; : &#39;.&#39;);<br>  Serial.print(F(&quot;] &quot;));<br>  int hp = (int)health;<br>  if (hp &lt; 100) Serial.print(&#39; &#39;);<br>  if (hp &lt; 10)  Serial.print(&#39; &#39;);<br>  Serial.print(hp);<br>  Serial.print(F(&quot;  &quot;));<br><br>  // ECG trace (35)<br>  Serial.print(&#39;|&#39;);<br>  int col = constrain((int)(8 + ecgValue(now) * 20), 0, 30);<br>  for (int i = 0; i &lt; 31; i++) {<br>    if (i == col) Serial.print(&#39;*&#39;);<br>    else if (i == 8) Serial.print(&#39;:&#39;);<br>    else Serial.print(&#39; &#39;);<br>  }<br>  Serial.print(F(&quot;|  &quot;));<br><br>  // live press gauge (12): full at 3x the push threshold<br>  int force = constrain(map((int)fsrSmooth - fsrBaseline, 0, PRESS_DELTA * 3, 0, 8), 0, 8);<br>  Serial.print(&#39;[&#39;);<br>  for (int i = 0; i &lt; 8; i++) Serial.print(i &lt; force ? &#39;#&#39; : &#39; &#39;);<br>  Serial.print(F(&quot;]  &quot;));<br><br>  // next step / status<br>  if (defib == CHARGING) {<br>    int lvl = map(now - chargeStart, 0, CHARGE_TIME_MS, 0, 8);<br>    Serial.print(F(&quot;DEFIB CHG[&quot;));<br>    for (int i = 0; i &lt; 8; i++) Serial.print(i &lt; lvl ? &#39;=&#39; : &#39; &#39;);<br>    Serial.print(F(&quot;] keep at MAX&quot;));<br>  } else if (defib == CHARGED) {<br>    if (rhythm == BEATING)        Serial.print(F(&quot;CHARGED: has a pulse, DON&#39;T shock&quot;));<br>    else if (rhythm == FLATLINE)  Serial.print(F(&quot;CHARGED: flatline, shock = death&quot;));<br>    else if (health &gt;= SHOCK_READY_HP) Serial.print(F(&quot;!! CLEAR !!  turn pot to MIN&quot;));<br>    else                          Serial.print(F(&quot;CHARGED: hold MAX, CPR to HP 20&quot;));<br>  } else if (now &lt; cprTagUntil) {<br>    Serial.print(cprTag);<br>    if (cprRate &gt; 0 &amp;&amp; rhythm != BEATING) {<br>      Serial.print(F(&quot; (&quot;));<br>      Serial.print((int)cprRate);<br>      Serial.print(F(&quot;/min)&quot;));<br>    }<br>  } else {<br>    printHint();<br>  }<br>  Serial.println();<br>}<br><br>// Made in assistance with Claude Code Opus 5.5.</pre><h4>Excerpt of Index.Html, deployed at cpr-monitor.vercel.app</h4><pre>&lt;!doctype html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>&lt;meta charset=&quot;utf-8&quot;&gt;<br>&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;<br>&lt;title&gt;CPR Monitor&lt;/title&gt;<br>&lt;style&gt;<br>  :root {<br>    --bg: #000;<br>    --ink: #fff;<br>    --dim: #bdbdbd;<br>    --sinus: #00ff6a;   /* beating */<br>    --vfib: #ffd400;    /* V-fib */<br>    --asys: #ff2b2b;    /* flatline / dead */<br>    --defib: #00e5ff;   /* defibrillator charge */<br>    --accent: var(--vfib);   /* follows the rhythm */<br>  }<br>  * { box-sizing: border-box; margin: 0; }<br>  html, body { height: 100%; overflow: hidden; }<br>  body {<br>    font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;<br>    background: var(--bg);<br>    color: var(--ink);<br>  }<br>  /* Film-grain texture, kept faint so contrast stays high */<br>  body::before {<br>    content: &quot;&quot;;<br>    position: fixed; inset: 0;<br>    pointer-events: none;<br>    opacity: .07;<br>    mix-blend-mode: screen;<br>    background-image: url(https://medium.com/&quot;data:image/svg+xml,%3Csvg%20xmlns=&#39;http://www.w3.org/2000/svg&#39;%20width=&#39;240&#39;%20height=&#39;240&#39;%3E%3Cfilter%20id=&#39;n&#39;%3E%3CfeTurbulence%20type=&#39;fractalNoise&#39;%20baseFrequency=&#39;.9&#39;%20numOctaves=&#39;2&#39;%20stitchTiles=&#39;stitch&#39;/%3E%3C/filter%3E%3Crect%20width=&#39;100%25&#39;%20height=&#39;100%25&#39;%20filter=&#39;url(%23n)&#39;/%3E%3C/svg%3E&quot;);<br>  }<br><br>  /* Big readout */<br>  #readout {<br>    position: fixed; left: 0; right: 0; top: 30%;<br>    transform: translateY(-50%);<br>    display: flex; justify-content: center; align-items: baseline;<br>    color: var(--accent);<br>    font-variant-numeric: tabular-nums;<br>  }<br>  #bpm { font-size: clamp(88px, 15vw, 220px); font-weight: 400; line-height: 1; letter-spacing: -.02em; }<br>  #bpm-unit { font-size: clamp(22px, 3vw, 44px); font-weight: 700; font-style: italic; margin-left: .1em; }<br><br>  /* Rhythm name + next step */<br>  #sub {<br>    position: fixed; left: 0; right: 0; top: 44%;<br>    text-align: center; padding: 0 16px;<br>  }<br>  #rhythm { font-size: 14px; font-weight: 700; font-style: italic; letter-spacing: .12em; color: var(--accent); }<br>  #next { margin-top: 8px; font-size: clamp(20px, 2.6vw, 34px); font-weight: 700; }<br><br>  /* Health bar */<br>  #hp-wrap { position: fixed; left: 24%; right: 24%; top: 55%; }<br>  #hp-labels { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; font-style: italic; margin-bottom: 6px; font-variant-numeric: tabular-nums; }<br>  #hp-track { position: relative; height: 10px; border: 1.5px solid var(--ink); }<br>  #hp-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ink); }<br>  #hp-tick { position: absolute; left: 20%; top: -6px; bottom: -6px; width: 2px; background: var(--vfib); }<br>  #hp-tick-label { position: absolute; left: 20%; top: 14px; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--vfib); white-space: nowrap; }<br><br>  /* Chart */<br>  #chart-wrap { position: fixed; left: 24%; right: 24%; top: 63%; height: 21%; }<br>  #chart { width: 100%; height: 100%; display: block; }<br>  .axis-label { position: absolute; font-size: 14px; font-weight: 700; font-style: italic; }<br>  #lbl-time { left: 0; bottom: -22px; }<br>  #lbl-ecg { right: -36px; top: 0; }<br><br>  /* Side meters: press (left) and defib charge (right) */<br>  .meter { position: fixed; top: 63%; height: 21%; width: 14px; border: 1.5px solid currentColor; }<br>  .meter .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: currentColor; }<br>  .meter .label { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 14px; font-weight: 700; font-style: italic; white-space: nowrap; }<br>  #press-meter { left: calc(24% - 80px); color: var(--ink); }<br>  #press-tick { position: absolute; left: -6px; right: -6px; bottom: 33%; height: 2px; background: var(--vfib); }<br>  #defib-meter { right: calc(24% - 90px); color: var(--defib); }<br><br>  /* Event message */<br>  #msg {<br>    position: fixed; top: 16px; left: 50%; transform: translateX(-50%);<br>    max-width: min(640px, calc(100vw - 340px));<br>    text-align: center; font-size: 15px; font-weight: 700;<br>    padding: 8px 16px; border: 1.5px solid var(--ink); border-radius: 999px;<br>    background: var(--bg);<br>    opacity: 0; transition: opacity .35s;<br>  }<br>  #msg.show { opacity: 1; }<br><br>  /* Full-screen state messages */<br>  #state {<br>    position: fixed; inset: 0; z-index: 5;<br>    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;<br>    padding: 24px; text-align: center;<br>    opacity: 0; pointer-events: none;<br>    transition: opacity .25s, background-color .25s, color .25s;<br>  }<br>  #state-big { font-size: clamp(64px, 12vw, 180px); font-weight: 700; line-height: 1; letter-spacing: -.02em; }<br>  #state-small { font-size: clamp(18px, 2.4vw, 30px); font-weight: 700; }<br>  #state.clear { opacity: 1; background: var(--vfib); color: #000; }<br>  #state.clear #state-big { animation: blink .4s steps(1) infinite; }<br>  #state.warn  { opacity: 1; background: #000; color: var(--asys); box-shadow: inset 0 0 0 14px var(--asys); }<br>  #state.dead  { opacity: 1; background: var(--asys); color: #000; }<br>  @keyframes blink { 50% { opacity: 0; } }<br>  #flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .5s; }<br>  #flash.on { opacity: 1; transition: none; }<br><br>  /* Controls */<br>  #connect {<br>    position: fixed; top: 16px; right: 16px; z-index: 10;<br>    font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;<br>    padding: 8px 14px; border: 1.5px solid #fff; border-radius: 999px;<br>    background: #000; color: #fff; cursor: pointer;<br>  }<br>  #connect:hover { background: #fff; color: #000; }<br>  #serial-status {<br>    position: fixed; top: 16px; left: 16px; z-index: 10;<br>    max-width: 300px;<br>    font: 11px/1.4 ui-monospace, Menlo, monospace;<br>    padding: 6px 10px; border-radius: 8px; border: 1px solid #fff;<br>    background: #000; color: #fff;<br>    white-space: pre; overflow: hidden; text-overflow: ellipsis;<br>    display: none;<br>  }<br>  #serial-status.show { display: block; }<br>  #serial-status.bad { background: var(--asys); color: #000; border-color: var(--asys); }<br>  #keys { position: fixed; bottom: 12px; right: 16px; font-size: 11px; color: var(--dim); }<br>  #demo {<br>    position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 10;<br>    display: none; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center;<br>    max-width: calc(100vw - 32px);<br>    padding: 10px 14px; border-radius: 12px; border: 1px solid #fff;<br>    background: #000; color: #fff; font-size: 12px;<br>  }<br>  #demo.show { display: flex; }<br>  #demo input[type=range] { width: 120px; }<br>  #demo button { font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid #fff8; background: transparent; color: #fff; cursor: pointer; }<br>  #demo button.active { background: #fff; color: #000; }<br>  #demo .sep { width: 1px; height: 18px; background: #fff5; }<br>&lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br><br>// Made in assistance with Claude Code Opus 5.5.</pre><h3>Components Used</h3><blockquote>1x Arduino Uno R3</blockquote><blockquote>1x Small breadboard</blockquote><blockquote>1x Force sensor (FSR)</blockquote><blockquote>2x 1 kΩ resistor</blockquote><blockquote>1x 250 kΩ potentiometer</blockquote><blockquote>1x DC motor + off-center cardboard disk</blockquote><blockquote>1x NPN transistor (BJT)</blockquote><blockquote>1x Diode</blockquote><blockquote>1x 2 × AA batteries (1.5 V each, 3 V total)</blockquote><blockquote>1x Piezo</blockquote><blockquote>1x Blue LED</blockquote><blockquote>1x 220 Ω resistor</blockquote><h3>Artifacts</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZtWqiuyLe0E%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZtWqiuyLe0E&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZtWqiuyLe0E%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/99079b1c71612327987622c01913ce48/href">https://medium.com/media/99079b1c71612327987622c01913ce48/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DVXRZz2mOqPG32gMvSZEcw.png" /><figcaption>Schematic view of the POT, FSR, DC Motor, Piezo and LED circuit</figcaption></figure><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DXr09LT88pig&amp;type=text%2Fhtml&amp;schema=youtube&amp;display_name=YouTube&amp;src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FXr09LT88pig" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/033032dacf23ced2d2dbb1e4fd121030/href">https://medium.com/media/033032dacf23ced2d2dbb1e4fd121030/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FSCvhatoh3HM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DSCvhatoh3HM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FSCvhatoh3HM%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/644e32867e1af8c8d0ad3966436a779d/href">https://medium.com/media/644e32867e1af8c8d0ad3966436a779d/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yh6tXOgrb_rprp3JSMVMCA.jpeg" /><figcaption>Photo of the Constructed Demo</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5389e50a5c80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[W6 E2 — TDF DesComp]]></title>
            <link>https://medium.com/@cassiusp/w6-e2-tdf-descomp-b7043f94a1d0?source=rss-8cf63d0321cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7043f94a1d0</guid>
            <category><![CDATA[computational-design]]></category>
            <dc:creator><![CDATA[Cassius Palacio]]></dc:creator>
            <pubDate>Wed, 07 Oct 2026 02:03:18 GMT</pubDate>
            <atom:updated>2026-10-07T02:03:18.218Z</atom:updated>
            <content:encoded><![CDATA[<p>Week 6, Entry 1<br>Technology Design Foundations — Design Computation</p><p>The second session of the week was hands-on, starting with a tutorial on Google MediaPipe. Before we opened anything, there was a reminder I appreciated: not every problem requires a machine learning solution. Integrate these tools, yes, but think laterally about other ways to get the same result first. MediaPipe sits in an interesting spot in that conversation, because it hands you pretrained models for common vision tasks instead of asking you to train your own. We also picked up a quick thread from last time about GPUs: they handle this work so much better because computer vision runs on a similar style of calculation to graphics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nWTBsjRSjjvpyjscq7XbZw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_mcFp_EzVXtse04sMwYdw.jpeg" /><figcaption>Photos captured from interaction with Google MediaPipe.</figcaption></figure><p>Walking through the toolset, a few things stood out. Object detection connects to the image segmenter, which goes further with an interactive segmenter where you point at what you want isolated. The pose landmarker got the strongest endorsement in the room, roughly that working with anything in there is valuable. I starred the image embedder in my notes, since it connects directly to last week’s idea of turning images into vectors that can be compared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*0EVb2_w-IbF5MjxmXIR_tg.png" /><figcaption>Notes taken from lecture.</figcaption></figure><p>The pose landmarker matters most for what comes next. It is the first step in a chain that turns a body in front of a camera into something that can drive a character: capture the image, estimate the pose, map the keypoints to joint coordinates, and use those coordinates to drive a rig in a simulated environment. Model outputs become meaningful when they animate and interact inside a simulated world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MLUs6UygDOpgx0rnU-PGmw.png" /><figcaption>Captured from the lecture presentation.</figcaption></figure><h3>Teams of three and the DigiPhant</h3><p>Then came the project. We self-organized into teams of three, gave ourselves a team name (the slide even suggested asking an agent to blend our actual names into one), and created a new Unity Hub project called YOURTEAMNAME_Digiphant using the Universal 3D template, saved inside our Projects folder. From there we opened VS Code, confirmed the new team folder was visible, and told our agents to inspect the directory without making any changes.</p><p>The actual integration was assigned as homework, not something to do in class: give the agent the link to the course starter repo, have it read the repo, clone it to the right location, and follow the setup instructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0BIFnrPgNqMf8YVEanvHrQ.png" /><figcaption>Redacted capture from the lecture presentation.</figcaption></figure><p>Reading through the starter repo made the scope clear. It provides a rigged elephant, a reference Unity scene, and a Python tracking bridge that runs webcam capture through MediaPipe pose landmarking and sends movement signals to Unity over a local connection. The repo is written for agents as much as for students: the agent is expected to inspect your project and your computer, adapt the components to your setup, and record what it actually changed and verified. The goal is a three-person performance where each of us controls part of the elephant, calibrated from a neutral pose and recorded straight from the Game view.</p><h3>We are Paladin, Becoming the elephant</h3><p>The Unity tutorial itself came with a short list of resources: the Unity Manual, the Unity Scripting API, and the MediaPipe documentation. The advice that stuck was to actually read the user manual, because in Unity everything is manipulatable. The flip side of that freedom is a warning I wrote down twice: be wary of putting too many assets into your scene.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*aRZFPUx6gRAlPB0o5J7KlQ.png" /><figcaption>Notes taken from lecture.</figcaption></figure><p>The framing of the project made me laugh and then made me think. We pretend to be an elephant, and the job is to make that elephant interact with its simulated environment in a fairly normal way. Three human bodies (Me, Rohan K, and Freddie Y.) in front of one webcam have to coordinate into one animal that walks, turns, and reaches like it belongs in the savannah.</p><p>What I am taking from this week is that the hard part is no longer the model. MediaPipe already knows where a shoulder is. The design question is mapping: which human gesture should mean which elephant motion, and how three people share one body without fighting each other. My next steps are to look closer at the MediaPipe tools, study the elephant rig, and run the starter repo setup with my agent so our team can start iterating.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7043f94a1d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>