|
|
|
|
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
November 20, 2009, 08:45:54 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Sept 30th - New Price -
Axon
is now $94
Robot Forum
72,665
Posts in
9,267
Topics by
5,290
Members
Latest Member:
robertelson
Robot Forum
>
General Misc
>
Robot Videos
>
Robotic cat toy
0 Members and 1 Guest are viewing this topic.
Pages:
[
1
]
Author
Topic: Robotic cat toy (Read 3315 times)
Afroman
Expert Roboticist
Jr. Member
Helpful? 0
Offline
Posts: 29
Robotic cat toy
«
on:
August 02, 2008, 08:44:59 PM »
Just got done building this using SOR's Axon.
http://afrotechmods.com/cheap/cat_toy/cat_toy.htm
There's some code in there that you might find useful, dealing with random number generation
srandom(42);//sets the random seed to a random number I pulled out of my ass
pulse_length=467;
//a value of 467 cycles gives a 1ms pulse which puts the servo at -60 degrees
//a value of 700 cycles gives a 1.5ms pulse which puts the servo at 0 degrees
//a value of 933 cycles gives a 2ms pulse which puts the servo at +60 degrees
while(1)
{
i = rand(); //rand() returns a random number between 0 and 32767
i=i>>6; //divide the random number by 64 to get it between 0 and 512
pulse_length=i+467; //add on the minimum pulse length to get a random pulse length between
//467 and 979 cycles which corresponds to roughly 1 to 2ms
delay_time = rand() >> 6; //makes the delay random number of servo cycles
//between 0 and 512
for(i=0; i< delay_time;i++)
{
servo(PORTA,7,pulse_length); //outputs a servo pulse on PORT A, pin 7
delay_ms(20); //servos usually expect a 20ms delay between each servo pulse
}
}
Logged
Admin
Administrator
Supreme Robot
Helpful? 62
Offline
Posts: 8,610
Re: Robotic cat toy
«
Reply #1 on:
August 03, 2008, 07:13:44 AM »
lol
Im imagining the laser high up in the air, and using 2 servos (for x and y motion).
I'm linking this over to the main Axon page
Logged
subscribe to SoR's YouTube account
pomprocker
Supreme Robot
Helpful? 15
Offline
Posts: 1,411
Sorry miss, I was giving myself an oil-job.
Re: Robotic cat toy
«
Reply #2 on:
August 04, 2008, 09:20:29 AM »
cat named pikachu, robots named pikachu
Logged
Blog:
Nerd Stuff - Programming, Electronics, Mechanics
Pages:
[
1
]
Jump to:
Please select a destination:
-----------------------------
General Misc
-----------------------------
=> Misc
=> Robot Videos
-----------------------------
Software
-----------------------------
=> Software
-----------------------------
Electronics
-----------------------------
=> Electronics
-----------------------------
Mechanics and Construction
-----------------------------
=> Mechanics and Construction
Related Topics
Subject
Started by
Replies
Views
Last post
robotic arm
Mechanics and Construction
junior000
18
2289
August 27, 2009, 04:23:14 PM
by
wil.hamilton
Robotic Evolution
Misc
nanobit
3
694
January 07, 2009, 03:01:06 PM
by
nanobit
need a project on robotic arm
Misc
macksharma
3
464
August 26, 2009, 01:37:25 PM
by
Canabots
Programming a robotic hindbrain
Software
disconnector
1
184
September 10, 2009, 09:10:55 PM
by
Ro-Bot-X
Advertise on this Forum
Loading...