Go Down

Topic: LittleBits: Activate Servo at Intervals (Read 183 times) previous topic - next topic

pandalinnie

Oct 13, 2017, 04:51 am Last Edit: Oct 13, 2017, 05:42 am by pandalinnie
Good day,

A bit of a coding amateur, but was wondering what the best code is to programme LittleBits. Its basically a battery power connected to the Arduino board connected to the servo.

Aiming to activate the my servo at 20 minute intervals, for a period of about 5 seconds? Is the millis() function ideal? Saw some samples online but they are just for LEDs not Servos. >< 

Help would be appreciated! Many thanks!

Delta_G

#1
Oct 13, 2017, 05:13 am Last Edit: Oct 13, 2017, 05:14 am by Delta_G
Good day,

A bit of a coding novice, but was wondering what the best code is to programme my LittleBits circuit.
You mean the circuit we can't see? 

Aiming to activate the my servo at 20 minute intervals, for a period of about 5 seconds?
See the Blink Without Delay example. 
If at first you don't succeed, up - home - sudo - enter.

pandalinnie

Good day,

A bit of a coding amateur, and just want to get something working for my school project. I was wondering what the best code is to programme my LittleBits servo. (Its basically a battery power connected to the Arduino board connected to the servo. )

Aiming to activate the my servo at 20 minute intervals, for a period of about 5 seconds? Is the millis() function ideal? Saw some samples online but they are just for LEDs not Servos.

Also how may I manipulate the time intervals? Would that be in seconds?

Such as this https://www.arduino.cc/en/Tutorial/BlinkWithoutDelay

Help would be appreciated! Many thanks!

pert

DON'T CROSS POST!!!!!!!!!!!!!!!!!!!!
http://forum.arduino.cc/index.php?topic=505361
I HAVE REPORTED THIS THREAD TO THE MODERATORS
And really, the first thread you created is pretty similar:
http://forum.arduino.cc/index.php?topic=503701


Coding Badly


Delta_G

#6
Oct 13, 2017, 03:08 pm Last Edit: Oct 13, 2017, 03:08 pm by Delta_G
Quote
Saw some samples online but they are just for LEDs not Servos.
Those examples you found are showing you how to do anything at times intervals.  The fact that they use an led and you want a servo means nothing.  Instead of turning on an led you want to run a servo.  So instead of putting led code inside that if statement that checks agains millis put your servo code. 

Quote
Also how may I manipulate the time intervals? Would that be in seconds?
The function is called millis.  Think about that for a little bit.  What time unit do you think it uses?  If you're still not sure then look that function up.  You can read documentation. You're not helpless.  But really the name should just give it away.
If at first you don't succeed, up - home - sudo - enter.

Go Up