micro:bit numbers station

Numbers stations are / were spooky shortwave radio stations, best known from the Cold War, which broadcast human voices reading numbers, usually in groups of five. It’s widely assumed these were / are used by many nations for communicating with secret agents in foreign countries, using an unbreakable one-time pad cipher.

You can spook yourself by listening to The Conet Project.

Or you can code a BBC micro:bit to be come your very own numbers station!

Use one of the micro:bit Python editors (such as the lovely new official online one) to flash the program below on to a micro:bit. If you have a micro:bit V2 you can hear the numbers from the built-in speaker, otherwise attach some headphones or an amplified speaker to pin 0 and GND.

If someone can add some code to play The Lincolnshire Poacher as well, I’d be very happy indeed.

from microbit import *
import speech
import random

numbers = ['zero', 'won', 'too', 'three', 'for',
          'five', 'six', 'seven', 'ate', 'nine']

while True:
    for i in range(5):
        speech.say(random.choice(numbers))
        sleep(500)
    sleep(1000)
Posted in computers, microbit | Tagged , , , , | Leave a comment

micro:bit Wordle game

screenshot of micro:bit Wordle game

I made a Wordle-like game in Python for the BBC micro:bit.

The code is pretty compact and easy to understand, so I think getting students to create their own version of this popular game or pick apart this one would make a nice activity. There are plenty of opportunities to improve it.

You could use it to:

  • teach some Python
  • learn about functions
  • learn about using global variables in functions
  • learn about slicing strings
  • use imports – I hide the word list in an import
  • experiment with the serial console in the new alpha micro:bit Python editor

You’ll need a micro:bit and a Chrome or Edge browser as it uses webUSB – you interact with the micro:bit using your computer’s keyboard and screen.

You get 5 guesses. It shows your progress on the micro:bit’s LED display: a bright LED means the right letter in the right place, a dim LED means the right letter in the wrong place.

It also prints out your progress in the serial console. Capital letters are in the right place, lower case in the wrong place: So

--a-T

means the word ends in T and has an ‘a’ in 1st, 2nd or 4th place.

You can download a hex file to flash direct onto a micro:bit or drag and drop onto the Python editor, plus the raw Python files over on GitHub: https://github.com/blogmywiki/wordobit.

You’ll probably want to add more words to words.py. You could also improve the program in lots of ways, for example add some simple encryption like ROT13 to the word list or add more word checking.

I also made a video to explain how it works and how to play it:

main.py code

from microbit import *
import random
import music
from words import wordlist

def newWord():
    print('New game!')
    display.clear()
    global word
    global turn
    word = random.choice(wordlist)
    turn = 0

newWord()

while True:
    print('Turn',turn+1)
    if turn > 4:
        print('You lose. Your score is X/5. The word was ' + word)
        music.play(music.POWER_DOWN)
        sleep(5000)
        newWord()
    guess = input('What is your guess? ')
    if len(guess) != 5:
        print('Not a 5 letter word!')
    else:
        progress = ''
        for a in range(5):
            if guess[a] in word:
                if guess[a] == word[a]:
                    display.set_pixel(a,turn,9)
                    progress = progress + guess[a].upper()
                else:
                    display.set_pixel(a,turn,4)
                    progress = progress + guess[a].lower()
            else:
                progress = progress + '-'
        print(progress)
        turn += 1
        if guess == word:
            print('Congratulations! Your score is ' + str(turn) + '/5')
            music.play(music.POWER_UP)
            sleep(5000)
            newWord()

words.py code

# List of 5 letter words hidden from main Python program view
wordlist = ['heart', 'aloft', 'float', 'banjo', 'scoop']
Posted in Uncategorized | Tagged , , , , | Leave a comment

Simple micro:bit video out

I love making little computers and getting video out from Arduinos and even micro:bits – IchiconQuest is a lovely self-contained, if eccentric, computer you can make with a micro:bit that has video out.

I stumbled upon the video above remarkably late – it’s just a simple demo by Kevin Moonlight to generate text on an NTSC composite video output on a TV using just a V1 micro:bit and 1 or 2 resistors. I had a go at re-making it, and succeeded!

How to wire up video out from a micro:bit

I’m grateful to @wifisheep for telling me that to make it work better, you should also put a 1K resistor on the red line between the phono and the clip. I had all sorts of weird earth issues without adding that – but still, quite impressive with two resistors.

screenshot of text from a micro:bit

Because very, very accurate timing is so crucial when generating video, the code for this is in C++, not in MakeCode or Python.

You can find the source code and HEX files you can flash direct on to a V1 micro:bit to try this for yourself on my GitHub: https://github.com/blogmywiki/microbit-video

I even made my own font!

wide font on a micro:bit

Posted in computers, microbit | Tagged , , , | Leave a comment

BASYS nostalgia fest

By Jacek Rużyczka - Self-photographed, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=6762692

BASYS was a newsroom computer system used very widely in the 1980s and 90s by many radio and TV broadcasters: the BBC and ITN in the UK, CNN and NBC in the USA, the ABC in Australia and probably many more. It’s been said that it was the invention of BASYS that made pioneering rolling news channel CNN possible.

It ran on central mini-computers connected to ‘dumb’ terminals in newsrooms like the DEC VT420, a beautiful device that could only display text but did so in gorgeous glowing green, orange or white phosphorescent characters on a cathode ray tube display. Many of those terminals ended up in skips, but to buy one on eBay now will cost you several hundred pounds.

I knew BASYS from its special BBC World Service incarnation, EDiT in Bush House in the early 90s. EDiT had a kind of sandbox area called bush.graffiti to encourage reluctant journos to use this new-fangled technology. Odd threads would be started which people would sign with strange pseudonyms. I still have a stack of printouts from bush.graffiti and I wrote about some of them here: http://www.suppertime.co.uk/blogmywiki/2021/07/the-tower-of-babel/

Another killer feature of BASYS was top-line messaging. This was before anyone had broadband internet at home, the World Wide Web was only just being invented and cell phones were certainly not smart, so the ability to send a quick, instant message to your colleagues was intoxicating. I even met my wife in bush.graffiti.

A while ago I asked for help finding info about BASYS as there’s precious little online, certainly no website devoted to it that I could find. Silence. I tried again recently and, maybe because Twitter’s algorithms have changed, I was positively inundated with info.

I’m still looking for any training manuals, preferably ones used to train journalists how to use it. I’d kind of love to make my MUD look like BASYS when you telnet into it…

Here’s a summary of what I’ve learned so far:

Origins

Destiny

  • When the original BASYS company got into trouble, ITN in London bought the company to protect its investment.
    But I didn’t know that…
  • ITN then sold BASYS to DEC. Yes, the computer company that made the mini-computers and terminals the system ran on.
  • DEC then sold it to Avid.
  • BASYS then was ported to Red Hat Linux and lived on for many years as Avid iNews. I checked out some technical manuals on iNews, and it’s really very similar to BASYS indeed, albeit running on Linux servers and at the client end on a Windows app with a GUI featuring buttons.

Hardware

  • @IsItBroke says BASYS at BBC TV new ran on ‘PDP11/54s with IBM ATs each with several serial port cards with VT100 terminals hanging off them (or could be printers or AutoScript promoters which behaves like printers) – these “Terminal Servers” connected to the PDPs over 10Base2 Ethernet.’
  • Originally the BBC’s Basys ran on a pair of Onyx computers but by the time it was being implemented at BBC TVC it was on DEC VAX superminicomputers – possibly 6100s. EDiT at Bush ran on three Vax 6200s. (via @kingsp10)

User interface

  • @mattjones0111 reminded me that although BASYS’s UI was text-only, it was quick to use with its keystrokes and keyboard shortcuts. It allowed horizontal split screens, copy-paste, top-line messaging. Great example of a highly focused UI.

Remote access

  • If you had a modem and maybe an acoustic coupler, you could dial into Basys systems when you were on the road to file your copy and access programme running orders. NBC journalists used Tandy / Radio Shack Model 100 portable computers, and one of my Twitter correspondents @Stephen_Neal used his Psion 5 to dial into Basys at BBC East in 1996.
  • Stephen also writes ‘I used BASYS at the BBC in Norwich and Cambridge 1995-1997. In Norwich it was based around serial terminals, but the new Cambridge newsroom had IP-connected PCs running terminal software. You could connect to the London BASYS system to look at Network running orders.’
  • @mattjones0111 wrote ‘I was a traffic reporter and based at a police motorway control room near Redhill. I had an ISDN line; one channel would connect to BASYS, the other would connect my mic to the studio in Guildford. I also had PSTN dial-up access which I could use from home.’

Trivia

  • It was hilariously easy to send a top-line message the wrong person by getting their username wrong. eg ‘[myeditor] is an idiot, sent to [myeditor]‘ (via @terrystiastny and others).
  • In Bush House, home of the BBC World Service, you could connect to the training system by typing ‘connect train’. The sysadmins changed someone’s password to ‘hacker’ for doing this too often.
  • The BBC World Service Bush House version of Basys was called EDiT.
  • Bush House usernames had 3 letters of surname, a number & 3 letter department code. My own was boo1opr (operations). Amusing ones were rub1pub (publicity) and pis1por (Portuguese for Africa).
  • The Basys console command “msgclean” which could be used to print off every top-line message sent on the Basys system (via @kingsp10)
  • @resourcefulco wrote ‘I was graphic designer on Breakfast Time at BBC Lime Grove, using a Quantel Paintbox. Bored, we tried to link it up to the main PDP-11, and one of the amazing BBC technicians came up with a tiny box that let us do primitive 3-D wire graphics (and slowed down the news autocue)…’
  • Up to v13 of Basys if you took a story which had just been saved in 2 column mode and typed CMD get old, then it would kill all 10 sessions on the CCU to which you were connected. Bug found in v3 and finally fixed in v14 (via @kingsp10)
  • @IsItBroke reported: ‘You could a trick routing a serial port from one Terminal Server to another; it was referred to as a “Permanent Virtual Connection” which we used for router control panels and the like; over the BASYS IP network.’

 

Posted in BBC, computers, media, nostalgia, radio, TV | Tagged , , , | 4 Comments

Bangle.js 2 hackable smartwatch – first impressions

The new version of the Bangle.js watch caught my eye on Kickstarter as the price seemed very reasonable. It’s a hackable smartwatch with lots of features: accelerometer, magnetometer, barometer, thermometer, colour LCD display, Bluetooth, heart rate sensor and GPS plus a pretty long battery life.

bangle.js 2 unboxing

It arrived yesterday, and I’ve been having a play.

First impressions were good, the packaging is lovely and the set-up card had enough to get me going. I found the UI a bit confusing but it makes sense as soon as you’ve actually read the instructions. You scroll up and down menus by moving your finger up and down the screen, then select with a button press. It also took me a while to figure out that the same length button press unlocks the phone and also then takes you to the main menu when you press it again.

It’s no Apple Watch, but it’s a fraction of the price – and readily hackable! The display looks amazing in direct light or sunlight. In dimmer lighting conditions, the backlight is slightly uneven with a faint shadow across the lower third of the screen, but it’s only noticeable in ‘light’ mode with black text on a white background. Put the display into ‘dark mode’ (which I prefer) or view in direct light and it’s not a problem at all.

Everything is loaded onto the phone via Bluetooth from a compliant web-browser like Chrome. There are already a few apps available here https://banglejs.com/apps/ and of course you can open the source code for each app in GitHub and tinker with it.

What really impressed me straight away was how quickly you can put code on the watch and test run it. The card in the box has a demo altitude program. I typed it into the IDE, clicked the ‘Send to Espruino’ icon, paired the watch via Bluetooth, selected RAM to flash it to, and my demo code was running on the real watch in seconds. Very cool.

Here’s a quick demo I knocked up to show the temperature in a different font:

Bangle.setBarometerPower(1, "app");
require("FontTeletext10x18Ascii").add(Graphics);
Bangle.on('pressure',data => {
  g.reset().clearRect(Bangle.appRect);
  g.setFont("Teletext10x18Ascii").setFontAlign(0,0);
  g.drawString("Temp (c)", 88, 70);
  g.setFont("Teletext10x18Ascii",3).setFontAlign(0,0);
  g.drawString(data.temperature.toFixed(1), 88, 105);
});
Bangle.loadWidgets();
Bangle.drawWidgets();

montage of watch apps

The watch charges with a magnetic USB cable, but that’s all USB is used for – charging. There’s a sensible warning not to leave the USB cable plugged in but unattached to the watch, as it’s liable to attract a metal object and short!

A few niggles or wrinkles:

  • The altimeter needs calibrating in code, I really don’t think my lounge is 70m below sea level!
  • There’s no audible alarm, only a vibrate motor which is way too subtle to wake me up. I’ll still be using my phone to make sure I wake up in time for work!
  • The GPS receiver takes a very, very long time to get any data, at least on first use. In fact I’ve not managed to get it to work at all yet. 15 mins on a windowsill and a 40 minute outdoors walk were not enough. I think I’d have traded the GPS feature for a piezo speaker, but future firmware updates might improve this.

Overall I’m pleased with my purchase. The developer is very responsive on the forum and I look forward to modding existing apps, adding new ones as they appear as well as writing my own. Now, I really must get my classic Mac Chicago font working on this…

Chicago font on Bangle.JS watch

Posted in computers | Tagged , , , , | Leave a comment