Writing your Java program
Open the NetBeans IDE and create a new project named ZumoRobot.
- In the menu bar, click
File|New Project. TheNew Projectwizard will appear. In theNew Projectwizard, click onJavaunderCategoriesand click onJava ApplicationunderProjects. Then click theNextbutton:

Figure 5-20: Creating ZumoRobot project with NetBeans IDE - step 1. Image credits: Courtesy of Adafruit (https://www.adafruit.com/)
- In the
Name and Locationstep, typeZumoRobotfor theProject Nameandcom.packt.B05688.chapter5.ZumoRobotfor theCreate MainClass. Click theFinishbutton to create the project:

Figure 5-21: Creating ZumoRobot project with NetBeans IDE - step 2. Image credits: Courtesy of Adafruit (https://www.adafruit.com/)
- The NetBeans IDE will create a file named
ZumoRobot.javaand the project environment for you. - To work with Raspberry Pi GPIO pins, you should add the
Pi4jlibrary to your project as discussed in Chapter 1, Setting up Your Raspberry Pi. - Listing 5-1 presents the complete...