Just having a problem on my Raspberry Pi project
I have a web server running on a Raspberry Pi and I write a web interface with some buttons to control the Pi. The Pi will run the python script in a "while True" loop initially. It stands for auto mode.
Here is the question. When I click the button on the webpage, I want to switch to manual mode. That means I want to terminate the "while True" loop and run some other python scripts. How can I achieve it in my webpage? Also considering that I may want to switch back to auto mode.
window.prettyPrint && prettyPrint();
$('#power-switch').on('switch-change', function (e, data) {
if(data.value == true){
var $el = $(data.el)
, value = data.value;
//console.log('on',e, $el, value);//for debug
/*
add your function here
*/
js_pw_ON();
$('#auto-switch').bootstrapSwitch('setActive', true);
$('#lgt1').prop('disabled', false);
$('#lgt2').prop('disabled', false);
$('#lgt3').prop('disabled', false);
$('#lgt4').prop('disabled', false);
$('#lgt5').prop('disabled', false);
}