cyber-dojo traffic-lights

My friend Byran who works at the awesome Bluefruit Software in Redruth has hooked up his cyber-dojo web server to an actual traffic-light! Fantastic. Check out the video below :-)



Byran writes
It started out as a joke between myself and Josh (one of the testers at Bluefruit). I had the traffic lights in my office as I was preparing a stand to promote the outreach events (Summer Huddle, Mission to Mars, etc...) Software Cornwall runs. The conversation went on to alternative uses for the traffic lights, I was planning to see if people would pay attention to the traffic lights if I put them in a corridor at the event; we then came up with the idea that we could use them to indicate TDD test status.
Although it started out as a joke I am going to use it at the Summer Huddle, the lights change every time anyone runs a test so it should give an idea of how the entire group are doing without highlighting an individual pair.
The software setup is very simple, there is a Python web server (using the Flask library) running on a Raspberry Pi that controls the traffic lights using GPIO Zero. When the appendTestTrafficLight() function (in run_tests.js.erb) appends the traffic light image to the webpage I made it send an http 'get' request to the Raspberry Pi web server to set the physical traffic lights at the same time. At the moment the IP address of the Raspberry Pi is hard coded in the 'run_tests.js.erb' file so I have to rebuild the web image if anything changes but it was only meant to be a joke/proof of concept. The code is on a branch called traffic_lights on my fork of the cyber-dojo web repository.
The hardware is also relatively simple, there is a converter board on the Pi; this only converts the IO pin output connector of the Raspberry Pi to the cable that attaches to the traffic lights.
The other end of the cable from the converter board attaches to the board in the top left of the inside the traffic lights; this has some optoisolators that drive the relays in the top right which in turn switch on and off the transformers (the red thing in the bottom left) that drive the lights.
I have to give credit to Steve Amor for building the hardware for the traffic lights. They are usually used during events we run to teach coding to children (and sometimes adults). The converter board has LEDs, switches and buzzers on it to show that there isn't a difference between writing software to toggle LEDs vs driving actual real world systems, it's just what's attached to the pin. Having something where they can run the same code to drive LEDs and drive real traffic lights helps to emphasise this point.


cyber-dojo update

Between my recent fishing trips I have been working hard on a new cyber-dojo architecture.
  • pluggable default start-points so you can now use your own language/tests and exercises lists on the setup page
  • a new setup page for your own pluggable custom start-points
  • once I've got the output parse functions inside the start-point volumes I'll be switching the public cyber-dojo server to the new image and updating the running-your-own-server instructions
  • I've switched all development to a new github repo which has instructions if you want to try it now.


River Tone chub/roach

Last week I broke my Daiwa Spectron spliced-tip rod which has served me for 25 years+. After some searching around I replaced it with a Drennan Acolyte Ultra 14ft. I christened it yesterday with my heaviest ever bag on the Tone; 80lb+ of chub and roach with a few skimmer bream, one roach-bream hybrid, and several small perch. All caught on waggler, red/yellow/white maggot, on 1.7lb hooklength, and a size 20 Kamasan B560. Wooohooo.



Verdal salmon

Once a year a spent a glorious week fishing for salmon on the River Verdal in Norway. This year, despite the low water, I caught this cracker. A huge thanks to John Oldren who owns the beat. You will not find a more hospitable host. Also to Gary Scott for being super helpful as always.



Tulchan salmon

One of my favourite salmon beats is Tulchan on the river Spey.
On my most recent trip I caught two, including this beauty from Hunter's Pool.