Intermediate Software Training

Good Evening!

Welcome to the Control Systems Team! Now the fun can begin. This page will start to teach you a little bit of Java, and how make your programs interact with the outside world. This is the basic idea of robotics: Make programs that control things like motors and sensors to do things.

Like the Python language we showed you previously, Java is a programming language too. It has lots of parts. People spend years learning it, take whole classes in it, and do all sort of things with it. We're going to teach you some of the basics here so you can control the robots, but to get really good at it you're going to have to do some studying on your own.

Let's begin...

Introducing the Zebra Zero Environment

For this level of exercise, we're going to be using a training platform called the Zebra Zero. It consists of a Raspberry Pi Zero W microcomputer, and a breadboard.

What is a Raspberry Pi Zero W?

A Raspberry Pi Zero W is a tiny $10 computer. It has usb ports, a video connector, wifi, and a GPIO (General Purpose Input/Output?) connector to interface to the outside world. The pins on this GPIO connector perform a variety of functions such as power, ground, input, and output. The pins can programmed to behave in different ways. We'll be connecting to the Pi and running Java programs on it which control the GPIO connector and the world outside of the Pi.

What is a Breadboard?

A breadboard is an tool to quickly build circuits. It looks like this:

The lines of dots are all electrically connected to one another so wires can be slipped in and connected without any soldering. Look hear to learn more: [link]

Recall that we said in a prior activity that Python is a programming language. Its a language with syntax (nouns, verbs, etc). Java is the same. This is a java program:

public class HelloWorld{
   pubic static void main(String[] args) {
      System.out.println("Hello World");

If we tell the computer to run this code, it will print, you guessed it, 'Hello World'. The {} curly brackets are used to create blocks of code, the same thing was done in Python with indenting. HelloWorld? is a class aka a container, and when you run it java knows to automatically run whatever is in the main, which is to print something. You try it [here (Hint: Click execute to run the program)

That's the last dull program you'll write here. Lets do something more fun.

Last modified 4 years ago Last modified on Oct 2, 2017, 11:12:26 PM