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.

display → memory → input → time p5.js is the on-ramp. The graded block is still the reaction-time page.
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.

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 the same ideas with a fixation, a random delay, twenty trials, and an export. Write a predicted mean before the first scored trial.

Words for tonight

Lingo 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.
Class night

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, stimulus, buttons, one timed click.
19:15 Break
Predicted mean for the real block, written before the first trial.
19:25 Instrument
Instructor demo on rt.html, then a simple-RT block (~20 usable trials).
20:05 Modification
Arts: the mark. Science: choice RT and the two means.
Report
Still the RT report: prediction, n, mean, SD, one limit, CSV in data/.