element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Autodesk EAGLE
  • Products
  • More
Autodesk EAGLE
EAGLE User Support (English) Circulair PCB
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Autodesk EAGLE to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 9 replies
  • Answers 2 answers
  • Subscribers 172 subscribers
  • Views 827 views
  • Users 0 members are here
  • pcb
Related

Circulair PCB

Former Member
Former Member over 11 years ago

Hi Jorge.

 

I have to desgin a round PCB with 32pcs 3mm LED's on the outer side in a circle.

The diagonal size is 65 mm.

How do i get this circle devided in 32 simulair parts?

How do i rotate a component (shape) in degrees?

 

I'm running Eagle 6.4.0

 

Thanks in advance.

 

Ruud Rensen

  • Sign in to reply
  • Cancel
Parents
  • dukepro
    0 dukepro over 11 years ago

    On 09/24/2013 07:23 AM, Ruud Rensen wrote:

    Hi Jorge.

     

    I have to desgin a round PCB with 32pcs 3mm LED's on the outer side in a

    circle.

    The diagonal size is 65 mm.

     

    For this many LED's it's easy to write a program to produce a script.

    Attached is a program written in C that will do this.  Also attached is

    the Eagle script that this program produces.  The radius is a bit small,

    but it's good enough for demonstration.  Adjust the center point and the

    radius of the circle as necessary.

     

    Since this forum has problems with attachments making it to the web

    portal, I have included the source inline.

     

    C Program:

     

    /*

     

    • Program to produce an Eagle script to position

     

    • a number of LED's in a circle about a point.

    */

    #include <stdio.h>

     

    #define LED_COUNT   32

     

    // Dimensions are in mm and degrees

     

    // Center of circle

    #define CENTER_X    20.0

    #define CENTER_Y    20.0

     

    // Radius of circle

    #define RADIUS      20.0

     

     

    #define ARC_STEP    (360.0 / LED_COUNT)

     

    int main() {

        int led;

     

        printf("Grid mm;\n");

        printf("Mark (%.2f %2.f);\n",

            CENTER_X, CENTER_Y);

     

        for (led = 0; led < LED_COUNT; ++led) {

            printf("Move LED%d (P%.2f %.2f);\n",

                led + 1,

                RADIUS,

                ARC_STEP * led

                );

            printf("Rotate =R%.2f 'LED%d';\n",

                ARC_STEP * led,

                led + 1);

        }

     

        return 0;

    }

     

    // vim: set ts=4 sw=4 et ai:

     

     

     

    The Eagle script generated:

     

    Grid mm;

    Mark (20.00 20);

    Move LED1 (P20.00 0.00);

    Rotate =R0.00 'LED1';

    Move LED2 (P20.00 11.25);

    Rotate =R11.25 'LED2';

    Move LED3 (P20.00 22.50);

    Rotate =R22.50 'LED3';

    Move LED4 (P20.00 33.75);

    Rotate =R33.75 'LED4';

    Move LED5 (P20.00 45.00);

    Rotate =R45.00 'LED5';

    Move LED6 (P20.00 56.25);

    Rotate =R56.25 'LED6';

    Move LED7 (P20.00 67.50);

    Rotate =R67.50 'LED7';

    Move LED8 (P20.00 78.75);

    Rotate =R78.75 'LED8';

    Move LED9 (P20.00 90.00);

    Rotate =R90.00 'LED9';

    Move LED10 (P20.00 101.25);

    Rotate =R101.25 'LED10';

    Move LED11 (P20.00 112.50);

    Rotate =R112.50 'LED11';

    Move LED12 (P20.00 123.75);

    Rotate =R123.75 'LED12';

    Move LED13 (P20.00 135.00);

    Rotate =R135.00 'LED13';

    Move LED14 (P20.00 146.25);

    Rotate =R146.25 'LED14';

    Move LED15 (P20.00 157.50);

    Rotate =R157.50 'LED15';

    Move LED16 (P20.00 168.75);

    Rotate =R168.75 'LED16';

    Move LED17 (P20.00 180.00);

    Rotate =R180.00 'LED17';

    Move LED18 (P20.00 191.25);

    Rotate =R191.25 'LED18';

    Move LED19 (P20.00 202.50);

    Rotate =R202.50 'LED19';

    Move LED20 (P20.00 213.75);

    Rotate =R213.75 'LED20';

    Move LED21 (P20.00 225.00);

    Rotate =R225.00 'LED21';

    Move LED22 (P20.00 236.25);

    Rotate =R236.25 'LED22';

    Move LED23 (P20.00 247.50);

    Rotate =R247.50 'LED23';

    Move LED24 (P20.00 258.75);

    Rotate =R258.75 'LED24';

    Move LED25 (P20.00 270.00);

    Rotate =R270.00 'LED25';

    Move LED26 (P20.00 281.25);

    Rotate =R281.25 'LED26';

    Move LED27 (P20.00 292.50);

    Rotate =R292.50 'LED27';

    Move LED28 (P20.00 303.75);

    Rotate =R303.75 'LED28';

    Move LED29 (P20.00 315.00);

    Rotate =R315.00 'LED29';

    Move LED30 (P20.00 326.25);

    Rotate =R326.25 'LED30';

    Move LED31 (P20.00 337.50);

    Rotate =R337.50 'LED31';

    Move LED32 (P20.00 348.75);

    Rotate =R348.75 'LED32';

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • dukepro
    0 dukepro over 11 years ago in reply to dukepro

    On 05/14/2014 09:01 AM, Chuck Huber wrote:

    On 09/24/2013 07:23 AM, Ruud Rensen wrote:

    Hi Jorge.

     

    I have to desgin a round PCB with 32pcs 3mm LED's on the outer side in a

    circle.

    The diagonal size is 65 mm.

    For this many LED's it's easy to write a program to produce a script.

    Attached is a program written in C that will do this.

     

    I might also add that this could very easily have been done in a ULP

    rather than a C program.

     

    HTH,

        - Chuck

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • dukepro
    0 dukepro over 11 years ago in reply to dukepro

    The ULP version is below.

     

    HTH,

        - Chuck

     

    On 05/14/2014 09:03 AM, Chuck Huber wrote:

    On 05/14/2014 09:01 AM, Chuck Huber wrote:

    On 09/24/2013 07:23 AM, Ruud Rensen wrote:

    Hi Jorge.

     

    I have to desgin a round PCB with 32pcs 3mm LED's on the outer side in a

    circle.

    The diagonal size is 65 mm.

    For this many LED's it's easy to write a program to produce a script.

    Attached is a program written in C that will do this.

    I might also add that this could very easily have been done in a ULP

    rather than a C program.

     

    /*

     

    • Program to produce an Eagle script to position

     

    • a number of LED's in a circle about a point.

    */

     

    int LED_COUNT = 32;

     

    // Dimensions are in mm and degrees

     

    // Center of circle

    real CENTER_X = 20.0;

    real CENTER_Y = 20.0;

     

    // Radius of circle

    real RADIUS = 20.0;

     

    real ARC_STEP = (360.0 / LED_COUNT);

     

    string exitScript;

    string tmp;

     

        int led;

     

        sprintf(tmp, "Grid mm;\n");

        exitScript += tmp;

     

        sprintf(tmp, "Mark (%.2f %2.f);\n",

            CENTER_X, CENTER_Y);

        exitScript += tmp;

     

        for (led = 0; led < LED_COUNT; ++led) {

            sprintf(tmp, "Move LED%d (P%.2f %.2f);\n",

                led + 1,

                RADIUS,

                ARC_STEP * led

                );

            exitScript += tmp;

     

            sprintf(tmp, "Rotate =R%.2f 'LED%d';\n",

                ARC_STEP * led,

                led + 1);

            exitScript += tmp;

        }

     

        exit(exitScript);

     

    // vim: set ts=4 sw=4 et ai:

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • dukepro
    0 dukepro over 11 years ago in reply to dukepro

    One correction below:

     

    On 05/14/2014 09:15 AM, Chuck Huber wrote:

    /*

     

    • Program to produce an Eagle script to position

     

    • a number of LED's in a circle about a point.

    */

     

    int LED_COUNT = 32;

     

    // Dimensions are in mm and degrees

     

    // Center of circle

    real CENTER_X = 20.0;

    real CENTER_Y = 20.0;

     

    // Radius of circle

    real RADIUS = 20.0;

     

    real ARC_STEP = (360.0 / LED_COUNT);

     

    string exitScript;

    string tmp;

     

        int led;

     

        sprintf(tmp, "Grid mm;\n");

        exitScript += tmp;

     

        sprintf(tmp, "Mark (%.2f %2.f);\n",

    The second format specified should be "%.2f" instead of "%2.f".  This

    one slipped by.  Sorry.

     

            CENTER_X, CENTER_Y);

        exitScript += tmp;

     

        for (led = 0; led < LED_COUNT; ++led) {

            sprintf(tmp, "Move LED%d (P%.2f %.2f);\n",

                led + 1,

                RADIUS,

                ARC_STEP * led

                );

            exitScript += tmp;

     

            sprintf(tmp, "Rotate =R%.2f 'LED%d';\n",

                ARC_STEP * led,

                led + 1);

            exitScript += tmp;

        }

     

        exit(exitScript);

     

    // vim: set ts=4 sw=4 et ai:

     

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • dukepro
    0 dukepro over 11 years ago in reply to dukepro

    One correction below:

     

    On 05/14/2014 09:15 AM, Chuck Huber wrote:

    /*

     

    • Program to produce an Eagle script to position

     

    • a number of LED's in a circle about a point.

    */

     

    int LED_COUNT = 32;

     

    // Dimensions are in mm and degrees

     

    // Center of circle

    real CENTER_X = 20.0;

    real CENTER_Y = 20.0;

     

    // Radius of circle

    real RADIUS = 20.0;

     

    real ARC_STEP = (360.0 / LED_COUNT);

     

    string exitScript;

    string tmp;

     

        int led;

     

        sprintf(tmp, "Grid mm;\n");

        exitScript += tmp;

     

        sprintf(tmp, "Mark (%.2f %2.f);\n",

    The second format specified should be "%.2f" instead of "%2.f".  This

    one slipped by.  Sorry.

     

            CENTER_X, CENTER_Y);

        exitScript += tmp;

     

        for (led = 0; led < LED_COUNT; ++led) {

            sprintf(tmp, "Move LED%d (P%.2f %.2f);\n",

                led + 1,

                RADIUS,

                ARC_STEP * led

                );

            exitScript += tmp;

     

            sprintf(tmp, "Rotate =R%.2f 'LED%d';\n",

                ARC_STEP * led,

                led + 1);

            exitScript += tmp;

        }

     

        exit(exitScript);

     

    // vim: set ts=4 sw=4 et ai:

     

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube