Skip to main content Skip to local navigation
Home » Category: 'java'

java

Main Project Example for EECS 1021

Main Project Example for EECS 1021

The following is an example of a main project for the EECS 1021 course. While I think that it's important to provide concrete examples it's also important not to provide examples that are trivial to copy and, thus, reduce the effectiveness of the example as a learning tool. As such, I'm providing this example using […]

Unit testing for a project in Java

Unit testing for a project in Java

It's important to create test frameworks for your programs. In Java we use the jUnit system to do so. Here is an example of setting up a unit tester to make sure that that a method returns the values it's supposed to. First, let's look at the method. I'm using it to convert values that […]

Driver for the Grove Beginner Kit for Arduino

Driver for the Grove Beginner Kit for Arduino

For students attempting to get the USB drivers working for the Grove Beginner Kit for Arduino please follow these instructions: First: make sure that you're not using the white USB cable.  Use a different one. Second: install the USB driver for the board. a) Go to Seeed Studio's wiki: https://wiki.seeedstudio.com/Grove-Beginner-Kit-For-Arduino/ b) click on the USB driver […]

VPL: A Java Unit Test Example

VPL: A Java Unit Test Example

The following is an example of the files needed to create a working Virtual Programming Lab exercise for Java: vpl_run.sh vpl_evaluate.sh MainClass.java StudentSolution.java TeacherReferenceSolutions.java TheTestClass.java With this you can evaluate one student submission against a single reference solution. Two methods are run: one is the student's method and one is the teacher's method. The output […]

Java and Arduino: Serial Communication

Java and Arduino: Serial Communication

Before we started using Firmata and Firmata4j in the EECS 1021 class, Richard Robinson and I put together lab activities that used the Fazecast jSerialComm library paired with customized Arduino serial code. The approach is summarized in three videos: Video 1: The Plan for Sending Data to an Arduino We need to send information, in […]

Java and Arduino (2022 edition)

Java and Arduino (2022 edition)

In the EECS 1021 class here at York University the students learning about object oriented programming in an engineering that uses sensors and actuators. We use Arduino devices that host a special pre-made firmware called Firmata to do this in order to unburden the students from the C++ coding that would otherwise be required on […]

Automated student testing in Java (Part 1)

Automated student testing in Java (Part 1)

As with earlier posts for Matlab, I'm putting together a set of exercises for automated student testing in introductory programming classes, but this time for Java. The idea is to integrate this into Virtual Programming Lab or secure lab tests. In a future post I'll do a VPL version of this, but for now this […]

Serial Communications & Java

Serial Communications & Java

In my EECS 1021 class, in which we connect Java programs on a Mac or Windows machine with programs running on an Arduino-compatible board, we generally use Firmata. When combined with a library like Firmata4j (Java) or pyFirmata (Python), or Arduino-Octave (Matlab), Firmata provides an easy-to-use pathway for this to happen. It is, however, a […]

Easy Java + Arduino with Firmata (updated)

Easy Java + Arduino with Firmata (updated)

Arduino devices are commonplace in Engineering programs. Even if the profs don't use them, the students do. In Engineering programs, we often need to set up sensor monitoring or motor control systems. If students haven't worked with these in the first through third years of their programs, they are likely to encounter them in the […]

VPL, Vectors and Java

VPL, Vectors and Java

This is an example exercise in VPL. Grade is out of 1. All the students have to do is uncomment the creation of the MathVector object. Want to reproduce this example? PreLabC.java (the template for the student to work on) solution.txt (what the student's solution _could_ look like) MathVector.java (the class with all the methods […]