-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made the requested changes to the .adoc file (Testing section with cu…
…rl commands) & added path for the controller. Also created the LEDController.java file in the controllers directory.
- Loading branch information
1 parent
bc47e3b
commit 9d755e1
Showing
2 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
components/src/main/java/com/opensourcewithslu/components/controllers/LEDController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.opensourcewithslu.components.controllers; | ||
|
||
import com.opensourcewithslu.outputdevices.LEDHelper; | ||
import com.pi4j.io.gpio.digital.DigitalOutput; | ||
import io.micronaut.http.annotation.Controller; | ||
import io.micronaut.http.annotation.Get; | ||
import jakarta.inject.Named; | ||
|
||
|
||
@Controller("/led") | ||
public class LEDController { | ||
private final LEDHelper ledHelper; | ||
|
||
public LEDController(@Named("Led")DigitalOutput led){ | ||
this.ledHelper = new LEDHelper(led); | ||
} | ||
|
||
@Get("/led") | ||
public void checkLed(){ | ||
/*deviceOff method turns on the LED after checking the output. This | ||
will turn on the LED | ||
*/ | ||
|
||
ledHelper.deviceOff(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters