Category: Blog

Byte Insight

RoboCode

Robocode is a programming game, where the goal is to develop a robot battle tank to battle against other tanks in Java or .NET. The robot battles are running in real-time and on-screen.

Sense Hat

The Sense Hat from Raspberry Pi was developed as part of the Astro Pi Project.  The Sense Hat comes with its own library and a variety of hardware including: a 8×8 RGB LED matrix for output; a five-button joystick for user control; and the following sensors:

  • Gyroscope used to measure the positioning of an object
  • Accelerometer used to measure the rate of the velocity of an object
  • Magnetometer that provides an electronic compass
  • Temperature
  • Barometric pressure
  • Humidity

The purpose of this page is a quick guide to using the different aspects of the Sense Hat but for full details you should check out the API.

MySql – Insert

Inserting rows into MySql can be done in a couple of ways. You can use the INSERT…VALUES and INSERT…SET commands.

MySql

MySql is the worlds second most popular database engine (July 2013) and its open source. It is based on SQL (Sequential Query Language).  Unlike MS Access it does not run as a stand-alone application.   It runs as a background service on a computer (typically called ‘a server’) and you connect to it using a username and password.  Once you have connected to the MySql server you can query it using SQL or Structured Query Language.  The server will respond with the results of your query.

MySql – Create Database

If you need to create a database via the command line (or through the MYSQL prompt in PHPMyAdmin) then you can use the following where dynamo is the name of the database you wish to create. See W3Schools/Create DB for more information.

CREATE DATABASE dynamo;

MySQL – Create Table

The process and command for creating a table in MySql are similar to that for a database. You will need to make decisions about data types and key fields. Detailed information on creating tables is available at W3Schools/Create Table.

Python – Strings

A string is a list of characters and, in Python, they are easy to declare using speech marks.

myquote = “Talk is cheap. Show me the code.”

Network Configuation

One problem with using a Raspberry Pi in school is that you are protected from evil-web-ness by the PxxxY.  You see we cannnot even say the word without getting this page blocked too.  This page explains how to set up your RPi so you can access the network and internet.

Raspberry Pi

The Raspberry Pi is the infamous credit card sized computer that has revitalised the computer based experiementation first seen with the BBC Micro in the 1980s.   It runs a special flavour of Linux called Raspbian, which encourages students to explore the inner workings of a modern operating system.  The Pi comes with GPIO (General Purpose Input/Output) pins that allow it to be connected to external devices ranging from LEDs and motors to temperature and movement sensors.   There many things that you can do with a Raspberry Pi including:

Light Sensor

This circuit is based on the ARDX 09 circuit from Oomlout.  It shows how the Arduino can monitor light values using a Photo Resistor and adjust a LED in response.