r8 One

The RPN calculator you program in Quadrate.

r8 One is an open-source pocket calculator with a keypad laid out for RPN, a memory LCD that needs no backlight, and a shell that runs the programs you type on it. None has been built yet, but the one on this page is running its real firmware.

leaves 42 on the stack

Press a sequence like this one to type it in, or click the calculator and use your keyboard. Esc clears the line and F1 to F5 are the keys under the screen.

Tap a sequence like this one to type it in, or tap the keys yourself.

Starting QDOS

Your stack and programs are kept in this browser, so they are still here when you come back.

A screen that keeps its picture

The display is a 2.7-inch Sharp memory LCD, 400 by 240 pixels, each one either ink or paper. It reflects the light around it instead of making its own, and it holds its picture with no power at all, so a calculator left on its stack costs next to nothing to keep showing it.

One bit per pixel is the whole colour budget. Everything the calculator draws is designed for it, from the stack to the graphs.

Two ways to type

The calculator is RPN: digits build a number, Enter pushes it, and an operator works at once. Undo takes back the last key, and Esc never touches the stack.

A line takes whole Quadrate, with definitions, loops and strings. Define a word in one and it works on the stack like any key.

leaves 49

Write a program, then run it

On the r8 One you type these on the keypad. Here, Run types them in for you, fast enough to watch, and leaves you on the result. Esc on the calculator comes back out.

Fibonacci, in a loop

A word with a stack signature, a counted loop, and two locals named with -> each time round.

fn fib(n:i64 -- r:i64) {
	0 1 rot             // the first two, under n
	0 swap 1 for i {
		-> b -> a       // name the pair
		b a b +         // and step it along
	}
	drop
}

30 fib
leaves 832040

A curve from straight lines

Forty-two lines between the edges of the screen, and a parabola appears in each corner where they cross.

fn art( -- ) {
	ui::cls
	0 21 1 for i {
		0 i 12 *  i 20 * 239  ui::line
		399 239 i 12 * -  399 i 20 * - 0  ui::line
	}
	ui::show
	loop {
		30 ui::frame drop
		ui::pressed "" != if { return }   // any key leaves
	}
}

art
any key leaves

A ball that bounces

Two words: one turns the ball back at a wall, the other draws it frame after frame, asking ui::frame for sixty a second.

// The speed, turned back at either wall
fn wall(p:d128 v:d128 hi:d128 -- r:d128) {
	rot dup 10.0 < if { drop drop abs return }
	< if { abs neg return }
}

fn bounce( -- ) {
	200.0 -> x  120.0 -> y
	3.0 -> dx   2.0 -> dy
	loop {
		60 ui::frame drop
		ui::pressed "" != if { return }
		x dx + -> x  y dy + -> y
		x dx 390.0 wall -> dx
		y dy 230.0 wall -> dy
		ui::cls
		x y 10.0 1 ui::circle
		ui::show
	}
}

bounce
any key leaves

Any word can be graphed

A word that takes x and leaves y is a function to plot. On the graph, TRACE follows the curve and CALC finds its zeros, extremes and areas.

fn f(x:d128 -- y:d128) { dup sin * }

-12.0 12.0 -12.0 12.0 ui::window
"f" ui::plot
Esc leaves the graph

The area under a curve

fnint integrates any word between two bounds. The whole bell curve e−x² has an area of exactly √π, and from −6 to 6 the calculator finds it to sixteen digits.

fn bell(x:d128 -- y:d128) { sq neg exp }

"bell" -6.0 6.0 fnint   // the area under it

pi sqrt                 // and the square root of pi
leaves 1.7724538509055159 over 1.7724538509055160…

Or on the graph, as a TI does it: type a curve into Y1, graph it, and CALC finds the integral between two bounds and shades it.

shades the hump: INTEGRAL=36

A program that works the graph pages

Everything the keys do, a program can do: cfg:: sets the angle mode, and gr:: writes the Y= slots, picks a zoom and presses GRAPH. The taylor app builds sine's Taylor series as text, a term longer each time round a loop, and graphs all six: every term hugs the curve a little further out, and when you leave, your own Y= and settings are put back as they were. Read it in the calculator's own editor, then run it.

opens it in the editor
graphs it; Esc leaves

And turned in three dimensions

Take x and y, leave z, and graph3 draws the surface as a wireframe. The arrows turn and tilt it, and + and − zoom.

fn g(x:d128 y:d128 -- z:d128) {
	dup * swap dup * + sqrt sin 4.0 *   // a ripple
}

"g" graph3
Esc leaves

A word made at the prompt lasts until the calculator is switched off. To keep one, open APPS, press NEW and write it in the editor.

The functions you reach for

  • Decimal, to 34 digits. Numbers are IEEE 754 decimal128, 128 bits wide, so 0.1 + 0.2 is exactly 0.3, as on paper. Whole numbers are 64-bit integers.
  • Scientific. Trigonometry, logarithms and powers, with each inverse on shift. Whole quarter turns are exact, so the sine of 180 degrees is 0.
  • Complex numbers, made from two reals with one key and shown as a+bi or in polar form.
  • Statistics. Six lists, one- and two-variable statistics, and linear, quadratic, exponential, power and log regressions.
  • Graphs. Plot functions and lists, or draw a surface as a wireframe you turn with the arrow keys.
makes 3+4i

Apps

These come with it, each a Quadrate program you can open and read.

clock
A stopwatch and a countdown timer, in large figures.
fin
Loan payments from any three of amount, rate, years and monthly payment.
mandel
The Mandelbrot set. Move with the arrows, zoom with + and −.
quad
Roots, vertex and graph of ax² + bx + c.
spring
A damped spring in real time, its height traced against time.
sudoku
Sudoku on the number keys, saved as you go.
taylor
Sine and five of its Taylor polynomials, written into Y= and graphed.
triangle
Solve a triangle from any three of its parts.
units
A value in one unit, shown in every other unit of its kind.
opens the list

An app is a folder with a main.qd in it. Plug the calculator into a computer and send the folder over with qdosctl, and the app is there at once.

Inside

DisplaySharp LS027B7DH01 memory LCD, 2.7 inches, 400 × 240, reflective
Keypad54 keys in 10 rows, with an Alpha face for letters and a Symbol face for Quadrate
ComputerESP32-S3: two 240 MHz Xtensa LX7 cores, 512 KB of RAM and 8 MB of PSRAM
Storage16 MB of flash
USBOne port. A computer can type at the calculator over it, and send it programs and apps.
SoftwareQDOS, free software under the GNU GPL

Where it stands

In development. The parts are chosen and the software runs: what you are typing on is QDOS itself, compiled for the browser. No r8 One has been built yet, so there is nothing to order.

Everything is open, from the firmware to the case. Follow along, or build one with us.