Ok, back to the code in reply #9...
Your LED code uses delays. As you have discovered, you cannot do anything else during a delay.
Find the post "Using millis() for timing". I think it is in the programming sub-forum. That will solve your problem.
Ok, back to the code in reply #9...
Your LED code uses delays. As you have discovered, you cannot do anything else during a delay.
Find the post "Using millis() for timing". I think it is in the programming sub-forum. That will solve your problem.
Robin2:
How can the camera slide if it is fixed to a rotating pivot.This is getting ridiculous.
...R
You only used to align the axis. Make the axis equal to the planet. Camera elevation is manual. Once aligned, it can track the Celestial body for days. Of course, photography is only possible when the celestial body is above the horizon.
sebatiantr:
Barn door doesn't have any shape. You can't put in a backpack and go outside.
I am gathering that if you have not seen anyone else do it, therefore your point of view is that you cannot do it.
My experience is that when one has that mindset, they will prove themselves right.
I was only pointing out that the disccussion of movement and mechanics was based on the barn-door system.
I am not advocating it due to the simple fact it is only good for less then an hour of tracking.
The rotary system can do 24 hour tracking.
"blink without delay" is vital. MorganS pointed it out, that must be used instead of delay().
dave-in-nj:
How can the camera slide if it is fixed to a rotating pivot.
This is getting ridiculous.
You only used to align the axis. Make the axis equal to the planet. Camera elevation is manual. Once aligned, it can track the Celestial body for days. Of course, photography is only possible when the celestial body is above the horizon.
I think I agree with you but I don't see how it relates to my comment?
...R
MorganS:
Ok, back to the code in reply #9...Your LED code uses delays. As you have discovered, you cannot do anything else during a delay.
Find the post "Using millis() for timing". I think it is in the programming sub-forum. That will solve your problem.
I couldn't find any free time but I'll read it.
MorganS:
Ok, back to the code in reply #9...Your LED code uses delays. As you have discovered, you cannot do anything else during a delay.
Find the post "Using millis() for timing". I think it is in the programming sub-forum. That will solve your problem.
I read the topic but I have to say I didn't understand. I found some sample code and make some modification.
Eventually made something stupid but it work I guess ;D
Everything start with button trigger.
Motor starts turning.
First 30 seconds all leds are off (no need)
Then turn on all of them
10 seconds later first led turn off.
20 seconds later second led turn off.
30 seconds third led off.
int ledPin1 = 10; // the number of the LED pin
int ledState1 = LOW; // ledState used to set the LED
unsigned long previousMillis1 = 0; // will store last time LED was updated
long OnTime1 = 10000; // milliseconds of on-time
long OffTime1 = 30000; // milliseconds of off-time
int ledPin2 = 11; // the number of the LED pin
int ledState2 = LOW; // ledState used to set the LED
unsigned long previousMillis2 = 0; // will store last time LED was updated
long OnTime2 = 20000; // milliseconds of on-time
long OffTime2 = 30000; // milliseconds of off-time
int ledPin3 = 12; // the number of the LED pin
int ledState3 = LOW; // ledState used to set the LED
unsigned long previousMillis3 = 0; // will store last time LED was updated
long OnTime3 = 30000; // milliseconds of on-time
long OffTime3 = 30000; // milliseconds of off-time
void setup() {
pinMode(2, OUTPUT); //Direction
pinMode(3, OUTPUT); //Step
pinMode(4, OUTPUT); //MS0
pinMode(5, OUTPUT); //MS1
pinMode(6, OUTPUT); //MS2
pinMode(22, INPUT_PULLUP); //Button
pinMode(10, OUTPUT); //Red LED
pinMode(11, OUTPUT); //Red LED
pinMode(12, OUTPUT); //Red LED
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
digitalWrite(6, LOW);
}
void loop() {
if(digitalRead(22) == LOW)
{
{
unsigned long currentMillis = millis();
if((ledState1 == HIGH) && (currentMillis - previousMillis1 >= OnTime1))
{
ledState1 = LOW; // Turn it off
previousMillis1 = currentMillis; // Remember the time
digitalWrite(ledPin1, ledState1); // Update the actual LED
}
else if ((ledState1 == LOW) && (currentMillis - previousMillis1 >= OffTime1))
{
ledState1 = HIGH; // turn it on
previousMillis1 = currentMillis; // Remember the time
digitalWrite(ledPin1, ledState1); // Update the actual LED
}
if((ledState2 == HIGH) && (currentMillis - previousMillis2 >= OnTime2))
{
ledState2 = LOW; // Turn it off
previousMillis2 = currentMillis; // Remember the time
digitalWrite(ledPin2, ledState2); // Update the actual LED
}
else if ((ledState2 == LOW) && (currentMillis - previousMillis2 >= OffTime2))
{
ledState2 = HIGH; // turn it on
previousMillis2 = currentMillis; // Remember the time
digitalWrite(ledPin2, ledState2); // Update the actual LED
}
if((ledState3 == HIGH) && (currentMillis - previousMillis3 >= OnTime3))
{
ledState3 = LOW; // Turn it off
previousMillis3 = currentMillis; // Remember the time
digitalWrite(ledPin3, ledState3); // Update the actual LED
}
else if ((ledState3 == LOW) && (currentMillis - previousMillis3 >= OffTime1))
{
ledState3 = HIGH; // turn it on
previousMillis3 = currentMillis; // Remember the time
digitalWrite(ledPin3, ledState3); // Update the actual LED
}
digitalWrite(3, HIGH);
delay(1);
digitalWrite(3, LOW);
delay(0);
}
}
}
sebatiantr:
I read the topic but I have to say I didn't understand.
We can't help unless you tell us exactly what part of the topic you are having trouble with.
I find things become much clearer after the 14th reading.
...R
Robin2:
We can't help unless you tell us exactly what part of the topic you are having trouble with.I find things become much clearer after the 14th reading.
...R
Using delay is easy to understand.
But using millis timing isn't that easy. You have to know somethings.
Anyway I already did it somehow.
But I read something that Arduino mega has 3 timer function and nano has 1.
I wrote this code a clone mega board and its work just fine.
But I'll use nano because its super small. Is this a problem?
sebatiantr:
But using millis timing isn't that easy. You have to know somethings.......
But I read something that Arduino mega has 3 timer function and nano has 1.
You have to know a great many more "somethings" to use HardwareTimers than to use millis().
...R
Ohh dear god what is hardwareTimers ![]()
I really enjoy playing with arduino but I'm 35years old cant find free time to read and try stuff.
Sad but I only have 4-5 hours free time in my regular day.
Anyway.
I guess I'm done.
I just need a good compact box and field trip.
I’d suggest that you just buy the Vixen or the clone. As you say, they are small and rectangular. Since theyhave already been designed and built, you can just use them, and won’t need to read or try anything.
I hope you get some awesome sky pics!
sebatiantr:
I really enjoy playing with arduino but I'm 35years old
I'm 66 so you have plenty of time to catch up - don't rush it.
...R
Thank you @ChrisTenone but there is no fun buying stuff.
It's winter time already I can't shoot stars until maybe march. I have plenty time try it myself.
@Robin2
All I can say

Sad but true.
I don't subscribe to your rather dismal view of later life.
...R
totally understandable ![]()
Thanks for help guys.
I 'll be back final result soon.
Ok We have the time. (Pic #3)
Don't worry, it gets worse.

ChrisTenone:
Don't worry, it gets worse.
I believe that number for is for the married man
ChrisTenone:
Don't worry, it gets worse.
I believe that number 4 is for the married man
ChrisTenone:
Don't worry, it gets worse.
this is another sad alternative ![]()