Category: Blog

Byte Insight

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.”

Serial

The Arduino Serial functionality can be used for both debugging and sending data to and from the device via other communication channels such as BlueTooth.

Tkinter Events

Tkinter employs a type of programming called Event-Driven which means that the program runs in a endless loop waiting for things (events) to happen.  In order for the program to respond to these events it needs to know what to listen for.  

Zumo Inertia

The Zumo Robot is fitted with a set of Inertia Sensors that can be used to detect collisions and determine bearings/direction. The later 1.2v of the Zumo Shield includes a Gyroscope.  

Time

It is not uncommon to use time (or dates) or programs in some way or another.   If you are writing games you might want to record how long something takes or give the player a restricted amount of time.  Thankfully Python has some pretty good libraries (datetime, time) to help you.

Potentiometer

This circuit is based on ARDX 8 which uses a potentiometer to change the flash rate of an LED.