Re: [Tutor] counting function calls

2017-04-13 Thread Alan Gauld via Tutor
On 13/04/17 17:10, marcus lütolf wrote: > Dear experts, Mats > I have found the solution, I put the counting variable at the wrong place: I don;t think so, what you have done now is count the times through the loop, but thats not (always) the same as the number of times the function gets called,

Re: [Tutor] counting function calls

2017-04-13 Thread marcus lütolf
ept KeyboardInterrupt: > print('PIR deaktiviert') Marcus. -Ursprüngliche Nachricht- Von: Mats Wichmann [mailto:m...@wichmann.us] Gesendet: Montag, 10. April 2017 15:15 An: marcus lütolf ; tutor@python.org Betreff: Re: [T

Re: [Tutor] counting function calls

2017-04-10 Thread Mats Wichmann
On 04/10/2017 01:55 AM, marcus lütolf wrote: > Dear experts, > I have written the following code for motion detection with a PIR sensor > with a function and > I need to count how many times the funtion is called, but I get a traceback: > > #!/usr/bin/python3 > import sys, time > import RPi.GPIO a

Re: [Tutor] counting function calls

2017-04-10 Thread Alan Gauld via Tutor
On 10/04/17 08:55, marcus lütolf wrote: > Dear experts, > I have written the following code for motion detection with a PIR sensor > with a function and > I need to count how many times the funtion is called, but I get a traceback: > > #!/usr/bin/python3 > import sys, time > import RPi.GPIO as gpi

[Tutor] counting function calls

2017-04-10 Thread marcus lütolf
Dear experts, I have written the following code for motion detection with a PIR sensor with a function and I need to count how many times the funtion is called, but I get a traceback: #!/usr/bin/python3 import sys, time import RPi.GPIO as gpio gpio.setmode(gpio.BOARD) gpio.setup(23, gpio.IN) coun