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

added temp sensor to mcp adc circuit config #9

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

iaconos
Copy link

@iaconos iaconos commented Dec 29, 2021

No description provided.

this change adds an analog temp sensor to tkgpio.py which mimics the same way that the potentiometer was implemented (using mcp adc). Below is a demonstration of how temp sensor could be added to circuit.

"adc": {
       "mcp_chip": 3002,
       "potenciometers": [
       {"x": 175, "y": 375, "name": "Potentiometer on ADC0", "channel": 0}
       ],
       "temp_sensors": [
        {"x": 350, "y": 375, "name": "Temp Sensor on ADC1", "channel": 1}
        ]
    }

This requires that both "potenciometers" and "temp_sensors" be always present, but that if either is not in use then none should be listed within the square brackets. For example, below would implement 0 pots and 1 temp sensor...

"adc": {
       "mcp_chip": 3002,
       "potenciometers": [
       
       ],
       "temp_sensors": [
        {"x": 350, "y": 375, "name": "Temp Sensor on ADC1", "channel": 1}
        ]
    }
@iaconos
Copy link
Author

iaconos commented Dec 29, 2021

this change adds an analog temp sensor to tkgpio.py which mimics the same way that the potentiometer was implemented (using mcp adc). Below is a demonstration of how temp sensor could be added to circuit.

"adc": {
"mcp_chip": 3002,
"potenciometers": [
{"x": 175, "y": 375, "name": "Potentiometer on ADC0", "channel": 0}
],
"temp_sensors": [
{"x": 350, "y": 375, "name": "Temp Sensor on ADC1", "channel": 1}
]
}

This requires that both "potenciometers" and "temp_sensors" be always present, but that if either is not in use then none should be listed within the square brackets. For example, below would implement 0 pots and 1 temp sensor...

"adc": {
"mcp_chip": 3002,
"potenciometers": [
],
"temp_sensors": [
{"x": 350, "y": 375, "name": "Temp Sensor on ADC1", "channel": 1}
]
}

Added min/max temp to temp sensor config. Slider resolution automatically adjusts according to range provided. 

Temp sensor json config now  requires min and max temp parameters. For example:

"temperature_sensors": [
        {"x": 82, "y": 350, "name": "Temp Sensor on ADC1", "channel": 1, "min_temperature":-30, "max_temperature":-5}
        ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant