This project aims to provide a easy to use USB experimental board for students of the first year. Instead of only using the standard log for their (yet simple) programs, they are able to integrate hardware into their applications, which makes programming more interesting. The project provides a Java API to access the hardware such as display, flash, ADCs, etc. on the target board over USB from the PC. This approach requires a high level of abstraction to make it possible to use a simple but flexible Java API hiding the hardware and communication details.
For advanced students, firmware based on the existing framework can be developed on the microcontroller and downloaded over USB or JTAG.
For communication and controlling the hardware a Atmel AT90USB1287 USB microcontroller is used. The following hardware components are accessible on the board:
-
3x12 Characters I2C/TWI LCD Display
-
Serial Interface (UART)
-
32 Mbit Serial Flash Memory (SPI)
-
4+1-Way Joystick
-
Loudspeaker
-
Microphone
-
Light Dependent Resistor (LDR)
-
Thermal Resistor (NTC)
-
4 LEDs
-
6 Buttons
The communication with the device is based on the Java libusb wrapper.
Each hardware component is represented by a Java class. Prior to using the class, the connection to the USB device must be established. The following code snippet shows how to write a string to the Display using the Display class.
// create and open the USB device Device dev = DeviceFactory.getDevice(); dev.open(); // create and initialize the display Display disp = new Display(dev); disp.init(true, true, true); // write a string to the display disp.write("Hello World"); // close the USB device dev.close();More information can be found in the javadoc.