YAPPgenerator_en
  • Yet Another Parametric Projectbox generator
  • What you need
  • Getting Started
  • Design Philosophy
  • Coordinate Systems
  • YAPPgenerator API
  • YAPP Box Settings
    • Multiple PCBs
  • Standoffs
    • pcbStands (advanced)
  • Connecting Base and Lid
    • Connecting Base and Lid (advanced)
  • Cutouts
    • n(h) - yappFromInside
    • p(6) - Cutout Depth
    • Placement of the project box
      • Cutouts in the Base Plane
      • Cutouts in the Lid Plane
      • Cutouts in the Front Plane
      • Cutouts in the Back Plane
      • Cutouts in the Left Plane
      • Cutouts in the Right Plane
    • Shapes
    • Optional Parameters
      • p(7) - Angle
      • n(a) = Polygon Definition
      • n(b)/n(c) - Mask Definition
      • n(d) - Coordinate System
      • n(e) - Position reference
      • n(f) - Alternate Origin
      • n(g) - PCB Selection
  • Box Mounts
    • boxMounts (advanced)
  • Snap Joins
  • Light Tubes
  • Push Buttons
    • Optional Parameters
  • Ridge Extension
  • Labels
  • Images
  • Hooks
  • Debugging
  • Advanced Options
    • Specify a PCB
    • Position reference
    • Polygon Definitions
    • Mask Definitions
  • Generating STL file from KiCad
  • License
Powered by GitBook
On this page

Push Buttons

PreviousLight TubesNextOptional Parameters

Last updated 1 year ago

If you have one or more tactile switches on your PCB you can make a knop guide with witch you can push the tactile switch. You can size the button in any dimension you like and you can control the height of the button above the Lid (all within limits).

The API for push buttons is:

//===================================================================
//  *** Push Buttons ***
//-------------------------------------------------------------------
//  Default origin = yappCoordPCB: PCB[0,0,0]
//
//  Parameters:
//   Required:
//    p(0) = posx
//    p(1) = posy
//    p(2) = capLength 
//    p(3) = capWidth 
//    p(4) = capRadius 
//    p(5) = capAboveLid
//    p(6) = switchHeight
//    p(7) = switchTravel
//    p(8) = poleDiameter
//   Optional:
//    p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness
//    p(10) = { yappRectangle | yappCircle | yappPolygon | yappRoundedRect 
//                    | yappCircleWithFlats | yappCircleWithKey } : Shape, Default = yappRectangle
//    p(11) = angle : Default = 0
//    p(12) = filletRadius          : Default = 0/Auto 
//    p(13) = buttonWall            : Default = 2.0;
//    p(14) = buttonPlateThickness  : Default= 2.5;
//    p(15) = buttonSlack           : Default= 0.25;
//    p(16) = snapSlack             : Default= 0.10;
//    n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside } 
//    n(b) = { <yappGlobalOrigin>,  yappLeftOrigin }
//    n(c) = { yappNoFillet }
//    n(d) = [yappPCBName, "XXX"] : Specify a PCB. Defaults to [yappPCBName, "Main"]
//-------------------------------------------------------------------

The three buttons in the above images are created with this code:

pushButtons = 
[
    [84.2, 30.7, 8, 8, 0, 2, 1, 3.5, yappCircle]
   ,[85,   13.5, 8, 5, 3, 2, 1, 3.5, yappRectangle]
   ,[85,    7,   8, 5, 3, 2, 1, 3.5, yappRectangle]         
];