Micro:bit with R Pi (1) – two steps forward …

I’d heard of this code editor called Mu Python which is a cut-down version of Python.

mu

It sounded just what I need to code my shiny new BBC micro:bit with our Raspberry Pi 2.

I went to the Mu website and downloaded the Linux version.  Now, don’t waste your time doing this!  That’s because it is not the version of Linux Mu that you need for your particular processor (which is an ARM processor) so don’t spend precious time downloading that!

Anyway, I got the impression, after reading the Raspberry Pi forum post mentioned below, that I had already got Mu because I had just had to reload my OS and software last week.  (Read my previous post Disaster struck! – disaster averted . )

After many abortive attempts and deleting the file I’d downloaded from the web, I managed to install Mu by going into the LX Terminal. (You might need Menu > Accessories >Terminal to get there.)

and typing in:

sudo apt-get update (press return)

sudo apt-get install mu (press return)

and hey presto when I looked in ‘Programming’ there it was, Mu!

If you haven’t updated your software recently you may not have Mu there to install.  In which case, you need to go into GitHub and there are some posts that explain this in the Raspberry Pi forum here: Programming a BBC microbit …  There is a lot to read there but I found it worth the learning.

Anyway, hope this helps if you’re stuck like I was.

Happy Raspberry Pi ing!

 

Disaster struck! – disaster averted

This week at Code Club we managed to knock the micro SD card out of the R Pi while we were working.  When I tried the R Pi again it was completely dead except for the red ‘ON’ light!  We didn’t even get the reboot message up – in fact all we got was a blank screen.

raspi_SDcard

Raspberry Pi 2 with Micro SD card from modmypi.com

Modmypi.com

I therefore had to reformat the card and load NOOBS again.  NOOBS stands for – New Out Of the Box Software.  (NOOBS has the Raspbian Operating System and all the other software e.g. Scratch, Python, Minecraft Pi as well as the capacity to reboot all this back.  You need to reboot if you corrupt your SD card, in a less spectacular way, e.g. by turning off before a proper shutdown.)

See my earlier post from November 11, 2014 What I wish I’d known about Raspberry Pi for more on shutting down properly.

Reformatting your micro SD card is fraught with danger.

Firstly, in order to put it in your PC you probably need an adapter as shown in the photo so that you can put the card into a slot for a standard-sized SD card.

Secondly, it is really important you know which drive your card is in. Mine was in E:/.  If you don’t check this carefully you could reformat, i.e. wipe, your hard disk!

This page: NOOBS set-up gives you all the instructions to format and reload your SD card.

Hope it helps if you have the same disaster!

Happy Raspberry Pi-ing!

 

Geek Gran learns Linux jargon – SSH

The lovely new MagPi (Issue 47) for July 2016 contains an article on robot kits on page 84-85.

MagPi

This is a previous edition of The MagPi

A previous issue in January 2016 (Issue 41) reviewed another robot kit (page 82) and I was pleased to say that I could understand what they were getting at, in almost all of the text.

The new article this July was not so easy to understand. It contains the acronym SSH with respect to joining the robot to the Pi.  SSH means Secure Shell and seems to be something about sending the program code over a wifi connection to the robot. It looks like there’s a particular SSH for Linux-type operating systems (OS) such as the Raspian OS used on my Pi.

When I’ve found out more about this I’ll add to this post.

 

Geek Gran interacts with Minecraft at last!

Over the last few months I’ve been trying to use Python with Minecraft and not succeeding until today.

Interact_with_Python

It was made easier when I bought a microSD card for the Pi Zero. The software is up-to-date so that really helps.  With an SD card adapter, I could put the microSD card into our Raspberry Pi model B and I thought I was home and dry.

I am following Carrie Anne Philbin’s instructions in her book ‘Adventures in Raspberry Pi’ or you can look at her Geek Gurl Minecraft video.  I just couldn’t get it to work and then read somewhere that you can only use Python2 with Minecraft.  That was the answer!  I followed her instructions and although when I put cd api/python into LXTerminal it wasn’t happy, when I followed the rest of the instructions my message appeared on the Minecraft game window, so I’ve cracked the interaction part.

By the way, I opened Python2 and used Idle, as a text editor, rather than the editor which she uses in her book.  Also, it seems to be important to use a capital letter in ‘Minecraft’ in line 2 of the code but I don’t know why.  One useful thing I found was that if I opened my previous Python3 attempts in Python2 they worked, consequently my failures were of some use after all.  So that’s as far as I’ve got, but presumably coding other features with Minecraft should be easy now that I’ve learnt to interact with mc!

Geek Gran learns to solder

My first soldering project is a zoo badge from DF Robot bought from PiHut (Twitter @ThePiHut ) .

Solder Panda

 

I only managed to make one solder (my husband did four) but, as you can see, the badge’s LED works, hooray!  These badges are a really great idea because they cost around a couple of £ or about 4$ so, if you make a real hash of it, you are not frying your expensive components.  You can collect six different animals and our grandchildren are going to love them.  The most difficult part was soldering the badge clip on so, ideally, I’d like the kit to have that work done already.  However, it’s all good practice and if the clip falls off I suppose I’ll have to have a go at soldering it back on.

By the way I forgot to say: I learnt the most about soldering from this Geek Gurl Diaries episode from Carrie Anne Philbin.

Gemma wearables starter pack – 4

Well our sewing went brilliantly and here’s the result:

Charlotte LED scarf2

Charlotte with coded scarf showing one of its colours. We’ve got pink, her favourite colour, in there of course!

We are using the Adafruit Gemma microcontroller which has a black PCB*, with a Flora NeoPixel v2 LED.  The clear nail polish worked a treat in keeping the wires separate. Most glues have some conductivity so they’re just not suitable.  Ramesh of London says he’s given weird looks when he goes to buy nail polish but it really does the trick!

LED scarf works
Gemma and battery box on the reverse

 

 

Now I want to move on and, rather than just adapt an example program, I would like to write my own. The language looks a lot like Python so it shouldn’t be too difficult.

Anyway it’s time for Leeds Raspberry Jam so I’d better stop playing and get moving!   (Next Leeds Raspberry Jam tickets here.)

Managed to do the same with a scarf for me at last night’s Leeds Raspberry Jam so we’ll have matching blinking scarves next year, in the pitch black, at Acomb Community Choir’s big carol sing.

Happy Raspberry Pi ing and tinkering!

*PCB – Printed circuit board

Gemma wearables Starter Pack – 3

At last success, and with batteries too, rather than taking power from the computer, so I can soon start sewing!

Gemma_working

One stumbling block was that I got an error:

avrdude: error: USBtiny_transmit 

It turns out that I needed to upload the code to the Gemma while its bootloader was working (i.e. the red light was still on).

avr doesn’t stand for anything apparently. It’s just a particular kind of chip used in the ATiny microcontroller from the Atmel Company.

avrdude  is a  command-line program for programming AVR chips. I assume that means it’s similar to the commands I put in the LX Terminal with my Raspberry Pi.

Well, happy making and tinkering in 2016 everyone!

Continue reading “Gemma wearables Starter Pack – 3”