Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Wednesday, 19 March 2014

Minecraft on Pi Controlling A Robot Arm

So basically my student using the python api for Minecraft on the Raspberry Pi has coded it so that when you hit a block it controls part of the USB robotic arm.
I'll put the code up later as an update to this post.

UPDATE 1: This setup will be on show Monday 24th at our Open Evening as well for those that would like to see it in real life.
UPDATE 2: Here is a link to the Python code that was written by my student that does all the stuff you see in the video. It should link to a shared directory on Google Drive (let me know if there are any problems).
UPDATE 3: Here is a link to the java code for the status updater that was developed and shown by my student at the STEM Fair yesterday.

Friday, 17 January 2014

Java, Unconstrained Arrays, Random Numbers and Me

A friend the other day (well a couple weeks back now I think) asked me to explain the following to them to confirm that they had understood what was required of them for a bit of course work they had to produce.

 "Write a Java program which defines an unconstrained array of user defined length n, that contains n Random numbers and outputs those random numbers that are even numbers.

My explanation re-affirmed their understanding of the problem. The next thing I did after our discussion was google this to see what had been put out there to help learning coders. To my amazement a near identical question had been asked on a website (not going to link to it). What annoyed me was that to see the answer I had to pay money! Hence why I won't link to the website. 

As I said this annoyed me, so here I am putting a solution up that I hope people find instead of the pay walled version out there. I suppose in a way I still have that spirit from the early days of computing about sharing information etc. Which to me always seemed to be a bit hippy like. And I like that thought.

My solution (see code below) is a Java console app. Didn't want to take up too much space with all the GUI stuff, I just wanted to get straight to the core of the solution without any extra baggage.

So I apologise for not having done an exciting post, or not using the most efficient java code. But hopefully some-one out there will find the post useful.

Friday, 22 November 2013

What to say?

First posts of a blog are always hard, well for me they are.

Last week I did a talk at a local CAS (Computing at Schools) meeting on Python and KS3. I knew I was going to be doing this talk for a while (before the Summer holidays), and I had been thinking "how do I support this talk?".
The idea of a blog quickly came to mind, and the name manic coding followed very quickly after. It kind of reminded me of my old retro games I enjoyed playing, such as Manic Miner and Jetpac. But also I thought it caught the mood of programming in education at the moment.
With the change of direction within the curriculum, moving from ICT to computing, there seems to be an air of panic. Due mainly to the Government not putting in any training budget to bridge the skills/knowledge gap, and expecting teachers to somehow get the knowledge and expertise required.
Luckily there is a great community out there on the CAS website, where sharing resources, constructive and informative discussion are the norm.

So here we are with the first post of Manic Coding.


NEWS: Wolfram Alpha comes to the Pi
Yesterday Wolfram Alpha announced to the world that in future releases of Raspbian the official Linux distro for the Raspberry Pi will now include a version of their Wolfram Language and Mathematica software.
As they point out in the post announcing this, the only other time that there software was bundled with a machine was the Next Cube from Next, which later got bought out by Apple and provided the basis for OS X. I wonder what did happen to the CEO of Next? (Yes I know it was Steve Jobs)

Wolfram Post Announcing Now on Raspberry Pi
Raspberry Pi Site Announce Wolfram Language and Mathematica on Pi, also includes how to get hold of it now.

What is exciting for me about this announcement is the fact that the Wolfram Language also supports physical computing via the GPIO (there is an example in the Wolfram link).
I've not used either the language or Mathematica, but I will be playing with it over the next few months (I'm sure I will write something about it on here).
I do like the potential that this gives for making some interesting lessons, and opening up the Pi for use in other subjects other than computing.

With Java (or the official Oracle port now part of Raspbian) the Raspberry Pi is becoming a nice little machine for those with a small budget to learn to program. For me the big advantage of the Raspberry Pi over using a PC/Mac/Linux computer is the cost and how easy it makes physical computing and connecting devices. It's being able to light up LED's, use a sensor, or control a robot that brings life to  the subject and gets children hooked.

See ya in the next post...

PS I think I'm down for doing a second talk in January on the Raspberry Pi and the devices that you can attach to it. I'm not sure how this will work yet. But an idea is formulating in my head as I type this up. I want it to be very hands on this time.