Week 2 · build the pieces, then measure

A timed response is a small program

Walk these six sketches in order. Each one names a part of rt.html: pixels on a display, a loop that refreshes, a value in memory, a stimulus, a button or key, and a clock. Then we use the real instrument and export a CSV. The same language is in the p5.js Web Editor.

display → memory → input → time p5.js is the introduction. The graded work is a personalized RT sketch in VS Code, plus prediction and numbers.
Step 1

Pixels on a display

Remix this step

The code in memory

Change a number or a string, then Run. This is the same idea as Week 1’s playground, with a canvas instead of a card. You can also open the p5.js Web Editor in another tab.

p5.js Web Editor
19:25 · the real instrument

You have the pieces. Now collect a block.

The studio is one trial and no file. It does not exclude anticipations or write a CSV. rt.html is a live sandbox: personalize the task, Run, then copy it into rt/rt.html in VS Code. Same assignment for everyone. Walkthrough: workflow.html § How you work this week.

Words for tonight

Terms we will keep using

  • String — text in quotes. A label on the canvas is a string.
  • Variable — a named slot in memory (let rt = 0).
  • Memory — where those values live until you write a file.
  • Display / GUI — the canvas, the mark, the buttons.
  • Pixel — one coloured cell. A 72-pixel square is the stimulus.
  • Refresh rate — how often draw() repaints (often 60 frames/s).
  • Input / output — key or click in; pixels and a number out.
Tonight

Agenda

18:00 Introduction
A program is input, memory, and a display. We will name the parts before we measure.
18:10 Studio
Six sketches: pixels, refresh, variables, a stimulus, buttons, and one timed click.
19:15 Break
Predicted mean for the real block, written before the first trial.
19:25 Instrument
Instructor demo on the rt.html sandbox, then a simple-RT block.
20:05 Modification
Personalize the task on rt.html, copy the sketch, paste into VS Code rt/rt.html.
Report
Push the edited page, the CSV, and lab-notes/week02.md. Paste paths, how you modified it, prediction, n, mean, SD, and one limit on Canvas.