Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beginning thermistor support. Issue 39. #115

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.opensourcewithslu.components.controllers;

import com.opensourcewithslu.inputdevices.ThermistorHelper;
import com.pi4j.io.gpio.digital.DigitalInput;
import com.pi4j.io.gpio.digital.DigitalOutput;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Get;
import jakarta.inject.Named;

@Controller("/thermistor")
public class ThermistorController {

private final ThermistorHelper thermistorHelper;
//maybe use multipin
public ThermistorController(@Named("thermistor-input") DigitalInput sensorInput, @Named("thermistor-output") DigitalOutput sensorOutput){
this.thermistorHelper = new ThermistorHelper(sensorInput, sensorOutput);
}

@Get("/value")
public int getThermistorValue(){
return thermistorHelper.getThermistorValue();
}
}
10 changes: 10 additions & 0 deletions components/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ pi4j:
pull: PULL_DOWN
debounce: 3000
provider: pigpio-digital-input
thermistor-input:
name: Thermistor Input
address: 18
provider: pigpio-digital-input
### DIGITAL OUTPUTS
digital-output:
# tag::digitalOutput[]
Expand All @@ -102,6 +106,12 @@ pi4j:
shutdown: LOW
initial: HIGH
provider: pigpio-digital-output
thermistor-output:
name: Thermistor Output
address: 27
shutdown: LOW
initial: HIGH
provider: pigpio-digital-output
# tag::multiInput[]
multi-digital-input: # <.>
rotary-encoder: # <.>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

==== Rotary Encoder
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change this to "Thermistor"

[.text-right]
https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/docs/asciidoc/components/inputComponents/thermistor.adoc[Improve this doc]

===== Overview
...

===== Components
...

===== Assembly Instructions
...

===== Circuit Diagram
...

===== Functionality
...

===== Testing
...

===== Troubleshooting
...

===== YAML Pin Order
...

===== Constructors
...

===== Methods
...

===== An Example Controller
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.opensourcewithslu.inputdevices;

import com.pi4j.io.gpio.digital.DigitalInput;
import com.pi4j.io.gpio.digital.DigitalOutput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ThermistorHelper {
private static final Logger log = LoggerFactory.getLogger(ThermistorHelper.class);
private String helperName;
private int globalValue;

public ThermistorHelper(DigitalInput sensorInput, DigitalOutput sensorOutput){
//maybe use multipin
}

public int getThermistorValue() {
return 1;
}
}