hello all, I have made a 16led rgb setup on table fan the fan speed is 1300 rpm(approx).I am using fast led library for the same with IR led as refrence point for the circum circle(connected to A5 pin arduino).
I am trying out to display just 4 dots at 1/4th of the circle from one another as shon in video below.
The code is as below:
/*
* IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
* An IR detector/demodulator must be connected to the input RECV_PIN.
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* http://arcfn.com
*/
#include <IRremote.h>
#include <FastLED.h>
#define LED_PIN 5
#define NUM_LEDS 16
#define BRIGHTNESS 100
#define LED_TYPE WS2812
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
#define DATA_PIN 5
#define CLOCK_PIN 13
#define UPDATES_PER_SECOND 1000
int RECV_PIN = 8; //pov receiver ir connected
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
pinMode(8,INPUT);
FastLED.setBrightness( BRIGHTNESS );
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
}
//44ms full circle complete
void loop() {
if (analogRead(A5)>=800) //connected ir receiver for refrence point
{
for(int i=0;i<=3;i++){
delay(7); //waiting to complete 1/4th of circumcirle distance (90deg)
leds[0] = CRGB::Red;
FastLED.show();
leds[0] = CRGB::Black;
FastLED.show();
}
Serial.println(millis()-t1);
}
}
The photo of the above program executed is shown
As per my assumptions for every 1/4th of the circumcirle only one led should lit as after these lines
leds[0] = CRGB::Red;
FastLED.show();
leds[0] = CRGB::Black;
FastLED.show();
nowhere I have used delays.But, still many dots of leds appear.Can someone help me out.
As per POVfinal pic(attached below) is the one I am trying to display.