Posts

Showing posts with the label #Python

MicroPython and micro:bit workshop - London 29 March

Image
I'm running a workshop on the micro:bit and MicroPython in London on 29th March. It's been organised by an old friend, Marc Barto, who runs the London Arduino meetup. London Arduino is not just about Arduino; they are interested in a whole range of computing topics, including the wonderful micro:bit. The workshop is free but numbers are strictly limited so sign up now to be sure of a place!

An array of micro:bits for the Raspberry Towers Jam

Image
Yesterday I mentioned that I'm running a BBC micro:bit workshop for the Jam at Raspberry Pi Towers on February 11th . The micro:bit kits from Kitronik have just arrived, and I'm expecting to finish the workshop materials early next week. The workshop uses MicroPython and the mu IDE running on a Raspberry Pi. It's suitable for beginners, and I think it will be a lot of fun. There's a bit more background in yesterday's post . I sill need a title, though. If you have a good idea for a title you can submit it here . If I use your title and you are the first to suggest it, I'll send you a free Kitronik Inventors kit , including a BBC micro:bit. Make sure you submit your idea by 10 PM UK today as I'll be closing the survey then!

Raspberry Pi and BBC micro:bit for C2Pi

Image
Right now the Raspberry Pi and the BBC micro:bit look like a winning team. If you're f ollowing this blog you will know that I am evaluating new hardware and software for C2Pi (the re-generated C3Pi, neé Trackbot). Over the weekend I discovered that the micro:bit now supports MicroPython. Since I am looking for a micro that supports a language with a REPL, I had to investigate. MicroPython on the pyboard I've been a fan of MicroPython for a while. It runs on several platforms, including a custom board (the pyboard). I first met the pyboard, and Damien George, (its designer, and the original implementer of MicroPython) at an Open Technology conference in Cambridge a couple of years ago. I learned that MicroPython is a full, optimised implementation of Python 3; the only difference lies in MicroPython's specialised libraries, which  focus on direct access to the hardware. At the time I felt that the pyboard and MicroPython had great potential but I couldn...

Three easy ways to avoid off-by-one errors in your software

Image
Here's how to avoid one of the commonest software bugs If you're in the software business you've probably encountered the dreaded 'off-by-one' error. An off-by-one error often occurs when an iterative loop iterates one time too many or too few. Someone might use "is less than or equal to" where "is less than" should have been used. It's also easy to forget that a sequence starts at zero rather than one. To put it another way, we sometimes fail to distinguish between a count (how many are there?) and an offset (how far is that from here?) Ten gaps in eleven posts These problems aren't unique to programming. At the time of the last millennium, there was a lot of discussion as to whether it should have been celebrated on 1st January 2000 or 2001. In debates about the millennium off-by-one errors may not be too serious. In software they can be fatal. How can you avoid them? Here are three techniques which help. I'll ...