![]() |
![]() |
![]() |
|
![]() Enthusiast ![]() Joined Dec 9, '05 From Germany Currently Offline Reputation: 0 (0%) ![]() |
It´s not the most usefull thing but i just felt the urge to build something like this
![]() ![]() This is the outcome: Arduino Micro Shift Light Test setup ![]() I used my mini DSO as signal generator, a wonderful little tool. ![]() ![]() ![]() ![]() |
![]() |
![]() |
|
![]() Enthusiast ![]() Joined Dec 9, '05 From Germany Currently Offline Reputation: 0 (0%) ![]() |
This is basically how i made it, would have been a lot easier with normal LEDs but i wanted them all to be able to blink blue so i had to use RGB LEDs.
I put 1000-2000 Ohm resistors in front of every used LED pin, they were still way to bright but thanks to the PWM outputs its easy to dim them and to make any color as i did with the yellow stage. ![]() And this is the code for the Arduino, not perfect, i still need to get some kind of rpm or frequency counter working, for now the code counts the time between the pulses: QUOTE int rev = 12;
int ledGr1 = 5; int ledGr2 = 13; int ledGr3 = 11; int ledG1 = 6; int ledG2 = 9; int ledRo = 3; int ledBl = 10; int ledAll = 8; unsigned long duration; void setup(){ Serial.begin(19200); pinMode(8, OUTPUT); pinMode(rev, INPUT); } void loop(){ Serial.print("Duration: "); Serial.println(duration); duration = pulseIn(rev, HIGH); if (duration < 800 && duration > 100) { digitalWrite(ledAll, HIGH); delay(40); digitalWrite(ledAll, LOW); delay(40); } if (duration < 2800) analogWrite(ledGr1, 20); if (duration > 2850 || duration < 800) analogWrite(ledGr1, 0); if (duration < 2500) analogWrite(ledGr2, 20); if (duration > 2550 || duration < 800) analogWrite(ledGr2, 0); if (duration < 2300) analogWrite(ledGr3, 20); if (duration > 2350 || duration < 800) analogWrite(ledGr3, 0); if (duration < 2000) analogWrite(ledG1, 20); if (duration > 2050 || duration < 800) analogWrite(ledG1, 0); if (duration < 2000) analogWrite(ledG2, 60); if (duration > 2050 || duration < 800) analogWrite(ledG2, 0); if (duration < 1500) analogWrite(ledRo, 40); if (duration > 1550 || duration < 800) analogWrite(ledRo, 0); if (duration < 1100) analogWrite(ledBl, 20); if (duration > 1150 || duration < 800) analogWrite(ledBl, 0); delay(50); } |
![]() ![]() |
Lo-Fi Version | Time is now: February 22nd, 2025 - 6:01 AM |