Lynxmotion Tech Support

www.lynxmotion.com
It is currently Sat May 18, 2013 3:46 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 234 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13, 14, 15, 16  Next
Author Message
PostPosted: Wed Sep 26, 2012 11:42 am 
Offline
Robot Guru
User avatar

Joined: Tue Nov 02, 2010 9:39 pm
Posts: 1431
Location: Quebec Canada
Kurt,

This is only "Mega" based library ?
He is using a Pro Mini ATmega328 16mhz 5v

_________________
Eric Nantel
Qc Canada

Always liked Robot... Now i am learning to make some...! Wonderfull...


Top
 Profile  
 
PostPosted: Wed Sep 26, 2012 12:12 pm 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 1:42 pm
Posts: 4414
The simple answer is, I don't know, it may work on 328s as well, I think I did try it out on the BotBoarDuino earlier. It has been awhile since I played with it... May have to dig it up and try it out again.

Kurt


Top
 Profile  
 
PostPosted: Wed Sep 26, 2012 1:39 pm 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 1:42 pm
Posts: 4414
Forgot to mention, that a version of the ServoEx Library is up on the thread: viewtopic.php?t=8038&p=80023#p80023
This was developed I believe for Arduino 1.0. I took a look at the differences to the Servo library between 1.0 and 1.0.1 and they are not much. Made local changes, which I will upload later as part of my refactoring the Hex code thread.

Kurt


Top
 Profile  
 
PostPosted: Sat Sep 29, 2012 1:17 pm 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 8:59 am
Posts: 3140
Location: Online @ innerbreed.co.uk
ok i have started to get somewhere with the programming.. :twisted:

Using the unsigned Servo_Trigger and millis(); function as shown in one of Eric's earlier posts i have managed to get the Blink servo to randomly move at random times as well as getting the Head_Rotate servo to move at random times along with random values by assigning the selected output pin with "Random_Trigger" set as its triggered value. so now the head looks and pause at random places in the room.

Kinda creepy having this bird keep looking at me as i type. :P

Progress.... :wink:

_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk/
Create, Innovate, Inspire.


Top
 Profile  
 
PostPosted: Sat Sep 29, 2012 1:36 pm 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 8:59 am
Posts: 3140
Location: Online @ innerbreed.co.uk
Code:
//--- Turn 160deg all the time ---
void HeadRotate(){

 
//---------------- Part that trigger the blink sequence ----------------
    unsigned long Servo_Trigger_currentMillis = millis();

    if (Servo_Trigger_currentMillis - Trigger_lastMillis >= Random_Trigger) {
      Trigger_lastMillis = Servo_Trigger_currentMillis;
      Random_Trigger = random(1000, 2000);
      ServoMove_Count = 0;
    }
   
    unsigned long curren_Millis = millis();
   
//---------------- Part that do the blink once triggered ----------------
    if (curren_Millis - last_Millis >= Fast_ServoDelay) {  // Delay of Fast_ServoDelay so the millis update those value at that rate
      last_Millis = curren_Millis;
      ServoMove_Count = (ServoMove_Count + 1);
     
      switch (ServoMove_Count) {
        case 90:
          Head_Rotate.write(Random_Trigger);
          break;
        case 390:
          Head_Rotate.write(Random_Trigger);
          break;
        case 590:
          Head_Rotate.write(Random_Trigger);
          break;
       
         
      }   
    }
   
}

_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk/
Create, Innovate, Inspire.


Top
 Profile  
 
PostPosted: Sat Sep 29, 2012 1:57 pm 
Offline
Robot Guru
User avatar

Joined: Tue Nov 02, 2010 9:39 pm
Posts: 1431
Location: Quebec Canada
I ain't look at the code itself.. but nice to see your making it move.. :)

_________________
Eric Nantel
Qc Canada

Always liked Robot... Now i am learning to make some...! Wonderfull...


Top
 Profile  
 
PostPosted: Sat Sep 29, 2012 2:56 pm 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 8:59 am
Posts: 3140
Location: Online @ innerbreed.co.uk
Lol...
DiaLFonZo Shield with Arduino Pro Mini 328 test

_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk/
Create, Innovate, Inspire.


Top
 Profile  
 
PostPosted: Sat Sep 29, 2012 3:15 pm 
Offline
Roboteer

Joined: Sat Apr 23, 2011 9:07 am
Posts: 262
Location: Maryland, USA
Hey Jonny,

He looks a little empty headed to me. Is that why they call them birdbrained? :lol:

Some very encouraging progress really.

_________________
Ted, RoboTed
Never quite finishing means never having to admit failure!


Top
 Profile  
 
PostPosted: Sat Sep 29, 2012 3:28 pm 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 8:59 am
Posts: 3140
Location: Online @ innerbreed.co.uk
I do always feel somewhat credited by your responses.
The new head and eyelid meg will arrive mid next week to fill that space in the head. so more testing then.

_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk/
Create, Innovate, Inspire.


Top
 Profile  
 
PostPosted: Sun Sep 30, 2012 1:01 pm 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 8:59 am
Posts: 3140
Location: Online @ innerbreed.co.uk
The armature is fully operational with the exception of the "eyelid mech" that arrives next week. :D

Eric i solved the trigger problem we talked about.
I made two triggers and called them up as routines rather than adding individual triggers per servo :) .

_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk/
Create, Innovate, Inspire.


Top
 Profile  
 
PostPosted: Mon Oct 01, 2012 4:09 am 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 8:59 am
Posts: 3140
Location: Online @ innerbreed.co.uk
:D
Perfect:

Code:
//====================--- I N N E R B R E E D F X ---=========================
//Project; Animatronic Owl for InnerbreedFX
//Description: Control for Jonny Poole - InnerbreedFX Animatronics
//Software version: V1.0
//Date: 01-10-2012
//Program origin: Eric Nantel.
//Programmer/s: Jonny Poole.       
//       
//
// This version of the code runs on the DiaLFonZo-Copter Shield with ProMini for the Arduino Environement
//
//=============================================================================


#include <Servo.h>


Servo Eye_Blink;
Servo Head_Rotate;
Servo Head_LeftRight;
Servo Head_UpDown;
Servo Neck_UpDown;
Servo Neck_LeftRight;
Servo Open_Wings; 
Servo Wings;

int Eye_Blink_Pos = 90;
int Head_Rotate_Pos = 90;
int Head_UpDown_Pos = 90;
int Head_LeftRight_Pos = 90;
int Neck_LeftRight_Pos = 90;
int Neck_UpDown_Pos = 90;
int Open_Wings_Pos = 90;
int Wings_Pos = 90;


unsigned long lastServoMillis_1 = 0;
unsigned long lastServoMillis_2 = 0;

unsigned long last_Millis = 0;
int Fast_ServoDelay = 1;      //Fast
int Medium_ServoDelay = 10; //Medium
int Slow_ServoDelay = 20; //Slow

unsigned long Trigger_lastMillis = 0;
boolean Servo_Trigger = false;
int Random_Trigger = random(1000, 2000);

int Servo_pos = 1;
int ServoMove_Count = 0;

int Head_Rotate_posDirection = 1;
int Head_LeftRight_posDirection = 1;
int Head_UpDown_posDirection = 1;
int Neck_UpDown_posDirection = 1;
int Neck_LeftRight_posDirection = 1;
int Open_Wings_posDirection = 1;
int Wings_posDirection = 1;


void setup()
 {Eye_Blink.attach(9);         
  Head_Rotate.attach(3);
  Head_LeftRight.attach(11);
  Head_UpDown.attach(10);           
  Neck_UpDown.attach(A0);         
  Open_Wings.attach(A1);         
//  FREE.attach(A2);         
  Wings.attach(A3);   
  delay(1000);}


//--- Main Loop ---
void loop()

{EyeBlinkFast();
 HeadMovements();
 WingsOC();}

//---------------- Sequence ----------------
void EyeBlinkFast()
    {TriggerCommand();
     
      switch (ServoMove_Count)
        {case 100:
          Eye_Blink.write(90);
          break;
        case 200:
          Eye_Blink.write(10);
          break;
        case 300:
          Eye_Blink.write(90);
          break;}}
                   
//---------------- Sequence ----------------
void HeadMovements()
    {TriggerCommand2();
     
      switch (ServoMove_Count)
        {case 1000:
          Head_Rotate.write(Random_Trigger);
          break;
        case 1500:
          Head_LeftRight.write(Random_Trigger);
          break;
        case 1200:
          Head_UpDown.write(Random_Trigger);
          break;
        case 2000:
          Neck_UpDown.write(Random_Trigger);
          break;}}
           
//---------------- Sequence ----------------
void WingsOC()
    {TriggerCommand2();
     
      switch (ServoMove_Count)
 
          {Open_Wings.write(160);
          break;
          case 500:
          Open_Wings.write(90);
          break;
          case 1800:
          Open_Wings.write(160);
          break;
          case 1000:
          Wings.write(130);
          break;
          case 1200:
          Wings.write(30);
          break;
          case 1400:
          Wings.write(130);
          break;}}

   

//---------------- Trigger Sequence One ------------
void TriggerCommand()
{unsigned long Servo_Trigger_currentMillis = millis();

    if (Servo_Trigger_currentMillis - Trigger_lastMillis >= Random_Trigger)
     {Trigger_lastMillis = Servo_Trigger_currentMillis;
      Random_Trigger = random(1000, 2000);
      ServoMove_Count = 0;}
   
   
    unsigned long curren_Millis = millis();
   

    if (curren_Millis - last_Millis >= 1)   
     {last_Millis = curren_Millis;
      ServoMove_Count = (ServoMove_Count + 1);}}


//---------------- Trigger Sequence Two ------------
void TriggerCommand2()
{unsigned long Servo_Trigger_currentMillis = millis();

    if (Servo_Trigger_currentMillis - Trigger_lastMillis >= Random_Trigger)
     {Trigger_lastMillis = Servo_Trigger_currentMillis;
      Random_Trigger = random(1200, 1800);
      ServoMove_Count = 2;}
   
   
    unsigned long curren_Millis = millis();
   

    if (curren_Millis - last_Millis >= 20)   
     {last_Millis = curren_Millis;
      ServoMove_Count = (ServoMove_Count + 10);}}

_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk/
Create, Innovate, Inspire.


Top
 Profile  
 
PostPosted: Mon Oct 01, 2012 6:05 am 
Offline
Robot Guru
User avatar

Joined: Tue Nov 02, 2010 9:39 pm
Posts: 1431
Location: Quebec Canada
What's perfect.. i don't see a video..!

_________________
Eric Nantel
Qc Canada

Always liked Robot... Now i am learning to make some...! Wonderfull...


Top
 Profile  
 
PostPosted: Mon Oct 01, 2012 7:22 am 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 8:59 am
Posts: 3140
Location: Online @ innerbreed.co.uk
HaHA. Just waiting for Lipo to charge for its first non-tethered, autonomous test.

_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk/
Create, Innovate, Inspire.


Top
 Profile  
 
PostPosted: Wed Oct 03, 2012 8:20 am 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 8:59 am
Posts: 3140
Location: Online @ innerbreed.co.uk
Better late than never.... :oops:


_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk/
Create, Innovate, Inspire.


Top
 Profile  
 
PostPosted: Wed Oct 03, 2012 8:28 am 
Offline
Robot Guru
User avatar

Joined: Tue Nov 02, 2010 9:39 pm
Posts: 1431
Location: Quebec Canada
AWESOME

do you like Arduino now?

_________________
Eric Nantel
Qc Canada

Always liked Robot... Now i am learning to make some...! Wonderfull...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 234 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13, 14, 15, 16  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group