gproduct
Posts: 59
Joined: Tue Aug 11, 2015 1:27 pm

Always run sensor script

Mon Sep 14, 2015 3:48 pm

Hello!
I've made a sensor script that if it detects it goes to certain functions.
My question is: What are the ways that that script runs all day everyday?
Just simply while(1){} or is there any better solution?
Thx :P :lol: :) :D :ugeek: :mrgreen:

User avatar
davidcoton
Posts: 5027
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: Always run sensor script

Mon Sep 14, 2015 5:15 pm

You may find an infinite loop is satisfactory, more likely it will need a delay in the loop to sample at an appropriate rate without using a processor core full time.
Signature retired

Return to “General discussion”