Psion Organiser II Bargraphs

Today, when searching for some other stuff, I came across some OPL (Organiser Programming Language, some sort of Pascal-ish bastard child of BASIC) code that I must have written around 2000, or so.

One of the programs was a set of functions to display bargraphs using user-defined characters on the two line text LCD of the Psion Organiser II. So I dug out my trusty old Psion Organiser II XP and cleaned up the code a bit.

Psion LCD bargraph

This might be of use to someone, therefore I publish it here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
udg:(x%, b0%, b1%, b2%, b3%, b4%, b5%, b6%, b7%)
  pokeb $180, 64 + x%*8
  pokeb $181, b0%; pokeb $181, b1%
  pokeb $181, b2%; pokeb $181, b3%
  pokeb $181, b4%; pokeb $181, b5%
  pokeb $181, b6%; pokeb $181, b7%

bargudg:
  udg:(0, 0, 0, 0, 0, 0, 0, 0,31)
  udg:(1, 0, 0, 0, 0, 0, 0,31,31)
  udg:(2, 0, 0, 0, 0, 0,31,31,31)
  udg:(3, 0, 0, 0, 0,31,31,31,31)
  udg:(4, 0, 0, 0,31,31,31,31,31)
  udg:(5, 0, 0,31,31,31,31,31,31)
  udg:(6, 0,31,31,31,31,31,31,31)
  udg:(7,31,31,31,31,31,31,31,31)

barchr$:(n%)
  if n% > 8
      n% = 8
  endif
  if n% = 0
      return " "
  endif
  return chr$(n% - 1)

When you add these functions to your Organiser, after calling bargudg: you can call barchr$:() just like chr$() to print bargraph characters to the screen or to concatenate them to a string. barchr$:() accepts integers in the range 0..8, 0 being actually a space, not an UDG.

Comments