Mar-12-2018, 12:12 AM
Hello,
I've just gotten into learning more about both linux and python, mostly via a raspberry pi. Ive got some questions that I don't really know how to word for googling. I thought I would post here and just sort of talk and see if anyone wanted to comment.
I am currently mostly wanting to do some home automation tasks with the pi and python.
1. If I want to use the pi to say, control some lights, act as a thermostat and turn a fan off and on, would this generally be best done with a separate program for each running simultaneously? Or is there a way to do this all in one giant program? I've read some about threading, but currently its above my head.
2. If I write a program to for example read a temp probe and return the value as x and have it running constantly in the background, is there a way I can reference my variable x in separate programs? For example could I have a script running that turns an LED off and on depending on the value of x, but in another script have x printed to the screen when condition z happens or something? I really don't know how to word this one to search for it.
3. As I understand programs are executed from top to bottom. If I have a condition that lets say I want to make an LED flash when true, how is this normally done?
I've just gotten into learning more about both linux and python, mostly via a raspberry pi. Ive got some questions that I don't really know how to word for googling. I thought I would post here and just sort of talk and see if anyone wanted to comment.
I am currently mostly wanting to do some home automation tasks with the pi and python.
1. If I want to use the pi to say, control some lights, act as a thermostat and turn a fan off and on, would this generally be best done with a separate program for each running simultaneously? Or is there a way to do this all in one giant program? I've read some about threading, but currently its above my head.
2. If I write a program to for example read a temp probe and return the value as x and have it running constantly in the background, is there a way I can reference my variable x in separate programs? For example could I have a script running that turns an LED off and on depending on the value of x, but in another script have x printed to the screen when condition z happens or something? I really don't know how to word this one to search for it.
3. As I understand programs are executed from top to bottom. If I have a condition that lets say I want to make an LED flash when true, how is this normally done?