Muutke küpsiste eelistusi

E-raamat: Java on the Raspberry Pi: Develop Java Programs to Control Devices for Robotics, IoT, and Beyond

  • Formaat: EPUB+DRM
  • Ilmumisaeg: 27-Sep-2021
  • Kirjastus: APress
  • Keel: eng
  • ISBN-13: 9781484272640
  • Formaat - EPUB+DRM
  • Hind: 67,91 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: EPUB+DRM
  • Ilmumisaeg: 27-Sep-2021
  • Kirjastus: APress
  • Keel: eng
  • ISBN-13: 9781484272640

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

Use Java to do whatever you want to do with the Raspberry Pi and the devices you need for your project. In theory, it should be possible, and even easy, to work with on the Pi. Unfortunately, reality is a bit different. This book features an extensive set of techniques that allow you to get close to bringing this theory to fruition.

You'll review some limitations on using Java imposed by the Raspberry Pi and Raspberry Pi OS, and even Java itself, and examine which ones might apply to your projects and your devices. You'll also explore solutions to address the limitations and l look at efficient development of Java for the Raspberry Pi. 

Java on the Raspberry Pi shows how to interact with a range of devices useful in robotics and IOT, overcoming the hurdles in doing so. It also covers off-loading work from the Raspberry Pi to an Arduino, leveraging its close-to-real time capabilities.  

What You'll Learn 
  • Develop with Java remotely using NetBeans 
  • Leverage available libraries to enable device interaction, and what to do if they don’t work 
  • Implement multi-processing, using an Arduino as a co-processor
  • Build sophisticated projects with multiple threads of execution, multiple processes, and even multiple systems 

Who This Book Is For

Experienced programmers who appreciate the benefits of Java and world class tools for application development and want to build robotics or IOT projects using the low cost, low power, and portability of the Raspberry Pi.

About the Author xvii
About the Technical Reviewer xix
Acknowledgments xxi
Chapter 1 Motivations
1(2)
Why the Raspberry Pi?
2(2)
The "Best" Raspberry Pi for Robotics
4(2)
The "Best" Raspberry Pi for IoT
6(1)
Why Java?
6(1)
Programmer Productivity
7(6)
Performance
13(1)
Industry Acceptance
13(1)
The Verdict
14(1)
Why Remote Development Using NetBeans?
15(3)
Why NetBeans?
18(1)
Summary
19(2)
Chapter 2 Raspberry Pi 3 Model B+ Setup
21(1)
Setup Considerations
21(1)
Choose the Operating System
22(1)
Load Raspberry Pi OS on the microSD Card
23(1)
Get Raspberry Pi OS
23(1)
Image Raspberry Pi OS
24(7)
Boot and Configure Raspberry Pi OS
31(1)
Initial Configuration
31(8)
Configure Remote Computing
39(1)
Configure the Interface Capabilities
40(3)
Install Java on Raspberry Pi OS
43(1)
What Java to Install?
44(1)
Check for Prior Java Installations
44(2)
Install the JDK 11
46(1)
Finish Java Installation
46(1)
Finish Pi3 Setup
47(1)
Summary
48(1)
Chapter 3 Raspberry Pi Zero W Setup
49(22)
Setup Considerations
49(1)
Choose the Operating System
50(1)
Load Raspberry Pi OS on the microSD Card
50(1)
Write Raspberry Pi OS
50(4)
Finish the Bootable microSD Card
54(2)
Boot and Configure Raspberry Pi OS
56(1)
Find the IP Address
56(1)
Connect to the Zero
57(1)
Update and Upgrade Raspberry Pi OS
58(1)
Additional Configuration
58(6)
Configure the Interface Capabilities
64(2)
Install Java on Raspberry Pi OS
66(1)
What Java to Install?
66(1)
Check for Prior Java Installations
67(1)
Install the JDK 11
67(3)
Summary
70(1)
Chapter 4 Set Up the Workstation
71(12)
Remote Computing with SSH
71(2)
Remote Computing with VNC
73(1)
Start the VNC Server
73(1)
Get and Start the VNC Viewer
74(3)
Tune the VNC Server
77(4)
Summary
81(2)
Chapter 5 Remote Java Development with NetBeans
83(40)
Choose NetBeans and Java Versions
83(1)
Install Java 11
84(3)
Install NetBeans 12.0
87(3)
Test the NetBeans Installation
90(5)
Configure the Raspberry Pi As a Remote Platform
95(5)
Test Remote Development
100(2)
Debug Remotely
102(1)
Fix Remote Debug
102(1)
Successful Debug
103(1)
Examine Variables While Debugging
104(1)
The Debugger Menu
105(1)
Run on the Raspberry Pi Without NetBeans
106(2)
Leverage NetBeans in Complex Projects
108(1)
Create and Test Libraries
109(4)
Use Libraries
113(4)
Choose Which Program to Run from NetBeans
117(1)
Run the Chosen Program on the Raspberry Pi Without NetBeans
118(1)
Just Download with NetBeans
119(2)
Summary
121(2)
Chapter 6 Device Support in Java
123(26)
Find Base I/O Libraries for Java
124(1)
Select the Best Base I/O Library
125(1)
Functional Coverage
125(1)
Performance
125(1)
Support
126(1)
Ease of Use
127(1)
The Base I/O Choice for This Book
128(1)
A Look at pigpioj
129(1)
A Look at diozero
130(2)
Evaluating the Choices
132(2)
The Final Choice - diozero
134(1)
Configure diozero in NetBeans
135(6)
Find (and Port) Device Libraries
141(2)
Java Device Library and diozero Base I/O
143(1)
Java Device Library and Non-diozero Base I/O
143(1)
C/C++ Device Library
144(1)
Python Device Library
145(1)
No Device Library
146(1)
Summary
146(3)
Chapter 7 The diozero Base I/O API
149(42)
diozero Utilities
149(1)
Connect Devices to a Raspberry Pi
150(3)
diozero SerialDevice
153(1)
Background on Raspberry Pi Serial I/O
153(2)
Constructors
155(1)
Read and Write Methods
156(1)
Support for Device Identity
157(7)
diozero I2CDevice
164(1)
Background on Raspberry Pi I2C
164(3)
Constructors
167(1)
Read and Write Methods
168(2)
diozero SpiDevice
170(1)
Background on Raspberry Pi SPI
170(1)
Constructors
171(1)
Read and Write Methods
172(1)
GPIO
173(1)
Background on Raspberry Pi GPIO
174(3)
diozero GPIO Classes
177(5)
Device Library and Application Structure
182(1)
RuntimelOException
183(1)
Safety Nets
184(4)
Safety Net Guidelines
188(2)
Summary
190(1)
Chapter 8 A DC Motor Controller
191(58)
Choose the Device
192(1)
Understand the Device
193(2)
Find a Device Library
195(1)
Search for Java Libraries
195(1)
Search for Non-Java Libraries
196(5)
And the Answer Is
201(1)
Porting Issues
202(1)
Device Library Interface
202(3)
Device Instances
205(1)
Verbatim vs. Cleansing Port
206(1)
Porting Approach
207(1)
Play with the Device
208(1)
Device Library Development
209(3)
RoboClaw Class
212(2)
Constructor Analysis and Implementation
214(4)
Mid-level Methods Analysis
218(1)
CRC-Related Methods
218(2)
Low-Level Methods Analysis
220(1)
Mid-level Methods Implementation
220(4)
Finish the Core
224(2)
Test the Core
226(9)
Complete the Implementation
235(11)
Summary
246(3)
Chapter 9 An Inertial Measurement Unit
249(84)
Understand the Device
250(2)
Find a Device Library
252(1)
A Search for Java Libraries
252(2)
A Search for Non-Java Libraries
254(1)
A Look at the C++ Libraries
254(1)
A Look at the C Libraries
255(1)
And the Answer Is
255(1)
Device Library Port
256(1)
Play with the Device (FXAS21002C)
257(2)
Device Library Development (FXAS21002C)
259(1)
Constructor Analysis and Implementation
260(5)
Configuration
265(3)
Read a Sample
268(3)
Test the Core
271(5)
Additional Thoughts
276(15)
Address Zero Offset and Noise
291(11)
Get Real
302(4)
What Next?
306(1)
Device Library Development (FXOS8700CQ)
306(5)
Constructor Analysis and Implementation
311(2)
Configuration
313(3)
Read Sample and Status
316(2)
Test the Core
318(5)
Events Again
323(6)
What Next?
329(2)
Summary
331(2)
Chapter 10 A Lidar Unit
333(38)
Understand the Device
334(1)
Find a Device Library
334(1)
Device Library Design
335(1)
Interface
335(2)
Common Methods
337(1)
Other Considerations
338(1)
Play with the Device
339(3)
Device Library Development
342(1)
Development Approach
342(1)
Lidar Core
343(1)
Implementation
344(4)
Test the Core
348(4)
Additional Methods
352(4)
Test the Additional Methods
356(4)
Additional Thoughts
360(9)
What Next?
369(1)
Summary
369(2)
Chapter 11 An Environmental Sensor
371(26)
Understand the Device
371(2)
Find a Device Library
373(3)
Use the diozero BME280
376(5)
Play with I2C and SPI
381(1)
To the Datasheet
382(1)
l2CDevice
383(4)
SpiDevice
387(5)
A Step Beyond Play
392(3)
Summary
395(2)
Chapter 12 An Analog-to-Digital Converter
397(16)
Understand the Device
398(1)
Finding a Device Library
398(2)
Use the diozero McpAdc
400(3)
Play with SPI
403(5)
Turn Play into Reality
408(4)
Summary
412(1)
Chapter 13 A Stepper Motor Driver
413(28)
Understand the Device
413(3)
Find a Device Library
416(1)
Search for Non-Java Libraries
416(1)
And the Answer Is
417(1)
Device Library Design
417(1)
Interface Design
418(1)
Device Library Development
419(1)
Play with the Device
419(3)
SilentStepStick Implementation
422(1)
Constructor Implementation
423(5)
Test SilentStepStick
428(4)
What Next?
432(5)
Speed Profiles
437(2)
Summary
439(2)
Chapter 14 A Project
441(32)
The Metronome
441(1)
Mechanical Design
442(4)
Electronic Design
446(1)
Software Design
447(1)
Project Component Testing
448(1)
Test waitForActive
448(4)
Test whenActivated
452(3)
Test addListener
455(3)
Metronome Development
458(5)
Go Beyond Initial Requirements
463(4)
Get Closer to the Real World
467(5)
Summary
472(1)
Appendix A1 Arduino Command Server
473(20)
Some Arduino Background
474(1)
Choose an Arduino
475(1)
The Command Server Pattern
476(1)
The command server Sketch
477(3)
command server File
480(4)
cmd executor.h File
484(1)
cmd executor file
485(2)
Test the Command Server
487(2)
The Command Server As a "Device"
489(1)
Test the "Device" from Raspberry Pi
489(3)
Summary
492(1)
Appendix A2 Custom Lidar Unit
493(28)
The Hardware Design
493(3)
Some Harsh Reality
496(1)
The Lidar Unit Sketch
497(2)
cmd executor.h
499(1)
cmd executor
499(5)
lidar.h
504(1)
lidar
505(2)
servo.h
507(2)
servo
509(3)
Test
512(2)
Lidar Unit "Datasheet"
514(1)
Power
514(1)
Interface
515(4)
Summary
519(2)
Appendix A3 NetBeans and Maven
521(28)
Create a NetBeans Project Using Maven and diozero
523(3)
Develop a Device Library
526(3)
Test the Device Library
529(3)
Run TestLED with a diozero Remote Provider
532(3)
RunTestLED on a Raspberry Pi
535(7)
Automate Build, Download, Run
542(4)
Summary
546(3)
Index 549
Greg Flurry has worked as a programmer and electronics engineer for IBM. In the span of a 40-year career, his roles have included product development, product architecture, research, and client services. He achieved the title of IBM Distinguished Engineer. Greg has authored over 50 articles in IBM and non-IBM publications on topics ranging from simple programming examples to large scale system architectures. He is an inventor, with over 30 patents. He started programming in Java from the time it became public in 1996, and over time, wrote thousands of lines of Java code. After retirement in 2013, he started working with the Raspberry Pi, with the goal of using it as the brain in autonomous robots. As the robots became more complex, he longed for Java and professional development tools. In 2017, he began using Java on the Raspberry Pi and has done so since, educating himself on the techniques of connecting sundry devices to the Raspberry Pi via Java, as well as identifying techniques useful in building moderately complex robotics systems.