https://github.com/llschall/jtrafficlight
Plug a traffic light to an Arduino board and control it from your own Java application.
https://github.com/llschall/jtrafficlight
arduino continuous-integration java serial-communication
Last synced: 4 months ago
JSON representation
Plug a traffic light to an Arduino board and control it from your own Java application.
- Host: GitHub
- URL: https://github.com/llschall/jtrafficlight
- Owner: llschall
- License: apache-2.0
- Created: 2023-09-22T12:07:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-19T23:02:26.000Z (over 2 years ago)
- Last Synced: 2024-02-20T00:22:55.954Z (over 2 years ago)
- Topics: arduino, continuous-integration, java, serial-communication
- Language: Java
- Homepage:
- Size: 4.16 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Plug a traffic light to an Arduino board and control it from your Java application.

# Deployment
## Java
* If you use Gradle, add the following dependency to your **build.gradle** file:
_implementation 'io.github.llschall:jtrafficlight:1.0.2'_
* Or if you do not use Gradle, you can download the jar from the page hereafter, and add it to your classpath.
https://repo.maven.apache.org/maven2/io/github/llschall/jtrafficlight/1.0.2
## Arduino
Download the **jtrafficlight_ino.zip** file from the page hereafter. Unzip and load it (without any modification) to your Aduino Board using the standard Arduino IDE.
https://github.com/llschall/jtrafficlight/releases/tag/v1.0.2
Plug your traffic light as follows:
- Connect the GND pins together
- Connect Arduino pin D2 to the red led
- Connect Arduino pin D3 to the yellow led
- Connect Arduino pin D4 to the green led

# JTrafficLight Java API
Everything is controlled from the Java side, no changes are required in the Arduino code.
See code example:
https://github.com/llschall/jtrafficlight/blob/main/src/main/java/org/llschall/jtrafficlight/LightCheck.java