From: Bernhard Tittelbach Date: Tue, 23 Mar 2010 13:51:24 +0000 (+0000) Subject: rf433ctl passende werte fuer led X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=2fb32081f6e153dd6529ae581b441a504160d649;p=svn42.git rf433ctl passende werte fuer led --- diff --git a/rf433ctl/rf433ctl.pde b/rf433ctl/rf433ctl.pde index 2edb9d4..9878159 100644 --- a/rf433ctl/rf433ctl.pde +++ b/rf433ctl/rf433ctl.pde @@ -277,13 +277,13 @@ void calculate_led_level(unsigned int pwm_pin) void flash_led(unsigned int times, unsigned int brightness_divisor, unsigned int delay_divisor) { - flash_led_time_ += 314*times; - unsigned int new_flash_led_brightness=256/brightness_divisor; - unsigned int new_flash_led_delay = flash_led_delay_ / delay_divisor; + unsigned int new_flash_led_brightness = 256 / brightness_divisor; + unsigned int new_flash_led_delay = 8 / delay_divisor; if (flash_led_time_ == 0 || new_flash_led_brightness > flash_led_brightness_) flash_led_brightness_=new_flash_led_brightness; if (flash_led_time_ == 0 || new_flash_led_delay < flash_led_delay_) flash_led_delay_=new_flash_led_delay; + flash_led_time_ += 314*times; } //********************************************************************// @@ -336,7 +336,7 @@ void loop() { if (ir_count >= IR_TRESHOLD) { - flash_led(1,2,1); + flash_led(1,8,1); Serial.println("movement"); } ir_time=IR_SAMPLE_DURATION;