亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? demo.c

?? CNC.rar
?? C
?? 第 1 頁 / 共 3 頁
字號:
//*****************************************************************************
//
// demo.c - CNC demonstration routines. 
// demo.c - CNC  示例程序
//
// Copyright (c) 2006-2007 Luminary Micro, Inc.  All rights reserved.
//
// Software License Agreement
// 軟件許可協議
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
// exclusively on LMI's microcontroller products.
//
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws.  All rights are reserved.  Any use in violation
// of the foregoing restrictions may subject the user to criminal sanctions
// under applicable laws, as well as to civil liability for the breach of the
// terms and conditions of this license.
//
// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
//
// This is part of revision 220 of sw01246.
//
//*****************************************************************************

#include <hw_types.h>
#include "demo.h"
#include "draw.h"
#include "i2c_slave.h"
#include "images.h"
#include "main.h"
#include "table.h"
#include "tool.h"
#include "virtualtimer.h"

//*****************************************************************************
//
//! \page main_demo_intro Introduction
//!
//! The demonstration routines are a set of examples that utilize the CNC
//! machine to actually draw something interesting.  There are six
//! demonstrations provided:
//!
//! - The first demonstration draws a logo and text stacked one on top of the
//!   other.
//!
//! - The second demonstration draws a logo and text side by side with an
//!   octagonal box surrounding both.  This is the only demonstration that is
//!   really designed for use on wood with a router; the end result can be used
//!   as a name plate (on a desk or on an office door).
//!
//! - The third demonstration draws a steer head.
//!
//! - The fourth demonstration draws one side of a printed circuit board.
//!
//! - The fifth demonstration draws a football (soccer) pitch.
//!
//! - The sixth demonstration draws a map of the world.
//!
//! The code for the demonstration routines is contained in
//! <tt>main_micro/demo.c</tt>, with <tt>main_micro/demo.h</tt> containing the
//! API definitions for use by the remainder of the application.
//
//*****************************************************************************

//*****************************************************************************
//
//! \defgroup main_demo_api Definitions
//! @{
//
//*****************************************************************************

//*****************************************************************************
//
//! The X coordinate of the corner of the workpiece when using the pen, based
//! on the table's mounting mechanism for paper material.  This is the absolute
//! corner of the workpiece; for a non-zero diameter pen (i.e. all pens!), this
//! value must be offset by the radius of the pen to place the entire pen tip
//! on the workpiece (and therefore avoid drawing off the paper and possibly
//! colliding with the paper holding mechanism).
//
//*****************************************************************************
#define PEN_CORNER_X            2500

//*****************************************************************************
//
//! The Y coordinate of the corner of the workpiece when using the pen, based
//! on the table's mounting mechanism for paper material.  This is the absolute
//! corner of the workpiece; for a non-zero diameter pen (i.e. all pens!), this
//! value must be offset by the radius of the pen to place the entire pen tip
//! on the workpiece (and therefore avoid drawing off the paper and possibly
//! colliding with the paper holding mechanism).
//
//*****************************************************************************
#define PEN_CORNER_Y            4800

//*****************************************************************************
//
//! The depth for the pen when traversing the table.  If the pen is on the
//! drawing surface and needs to be moved without drawing, this is the depth to
//! which the pen is moved before the traversal.
//
//*****************************************************************************
#define PEN_TRAVERSE            5200

//*****************************************************************************
//
//! The depth from the pen traversal depth when drawing on the table.  By
//! moving the pen to the traversal depth plus the drawing depth, the pen will
//! be on the table and therefore drawing lines.
//
//*****************************************************************************
#define PEN_DEPTH               800

//*****************************************************************************
//
//! The X coordinate of the corner of the workpiece when using the router,
//! based on the table's mounting mechanism for wood material.  This is the
//! absolute corner of the workpiece; for a non-zero diameter router bit (i.e.
//! all router bits!), this value must be offset by the radius of the router
//! bit to place the entire bit on the workpiece (and therefore avoid routing
//! the holding mechanism).
//
//*****************************************************************************
#define ROUTER_CORNER_X         625

//*****************************************************************************
//
//! The X coordinate of the corner of the workpiece when using the router,
//! based on the table's mounting mechanism for wood material.  This is the
//! absolute corner of the workpiece; for a non-zero diameter router bit (i.e.
//! all router bits!), this value must be offset by the radius of the router
//! bit to place the entire bit on the workpiece (and therefore avoid routing
//! the holding mechanism).
//
//*****************************************************************************
#define ROUTER_CORNER_Y         5885

//*****************************************************************************
//
//! The depth for the router when traversing the table.  If the router is on
//! the drawing surface and needs to be moved without drawing, this is the
//! depth to which the router is moved before the traversal.
//
//*****************************************************************************
#define ROUTER_TRAVERSE         (5300 - 360)

//*****************************************************************************
//
//! The incremental depth of each extra routing pass.  This is how much further
//! down the router is moved for each subsequent pass of the design, causing
//! the design to be cut deeper into the surface of the wood.
//
//*****************************************************************************
#define ROUTER_DEPTH_INCREMENT  90

//*****************************************************************************
//
//! The depth from the router traversal depth when drawing on the table.  By
//! moving the router to the traversal depth plus the drawing depth, the router
//! will be on the table and therefore drawing lines.
//
//*****************************************************************************
#define ROUTER_DEPTH            (360 + ROUTER_DEPTH_INCREMENT)

//*****************************************************************************
//
//! The number of steps per inch in the X and Y axes.
//
//*****************************************************************************
#define STEPS                   800

//*****************************************************************************
//
//! Convert from inches to steps.
//!
//! \param w is the whole number of inches.
//! \param f is the fraction number of inches, in thousandths of an inch.
//!
//! This macro converts a value specified as inches and thousandths of an inch
//! into the number of steps.  This allows specification of distances in inches
//! (which is much more natural than steps) and allows the steps per inches to
//! be changed (either with a different lead screw or a different stepper
//! motor) without having to change every distance reference.
//!
//! \return The number of steps in the specified distance.
//
//*****************************************************************************
#define INCHES(w, f)            ((STEPS * (w)) + ((STEPS * (f)) / 1000))

//*****************************************************************************
//
//! An array used to construct an image to be drawn on the table.  This is used
//! by the second demonstration for the border around the text and logo.
//
//*****************************************************************************
static unsigned short g_pusBorder[21];

//*****************************************************************************
//
//! Performs generic tool setup for a demonstration.
//!
//! \param pulX is a pointer to the variable to be filled in with the X
//! coordinate of the lower left corner of the workpiece for this tool.
//! \param pulY is a pointer to the variable to be filled in with the Y
//! coordinate of the lower left corner of the workpiece for this tool.
//! \param pulZ is a pointer to the variable to be filled in with the traversal
//! depth for this tool.
//! \param pulDepth is a pointer to the variable to be filled in with the depth
//! below the traversal depth.
//! \param pulIterations is a pointer to the variable to be filled in with the
//! number of iterations of the design to be performed.
//!
//! This function will perform common tool setup for a demonstration.  The
//! tool depths and drawing iteration are determined, and configures the
//! drawing routines with the required speed for drawing.
//!
//! \return None.
//
//*****************************************************************************
static void
DemoSetupTool(unsigned long *pulX, unsigned long *pulY, unsigned long *pulZ,
              unsigned long *pulDepth, unsigned long *pulIterations)
{
    //
    // See if the pen is the selected tool.
    //
    if(g_ulTool == 0x00)
    {
        //
        // Set the workpiece corner based on the pen tool.
        //
        *pulX = PEN_CORNER_X;
        *pulY = PEN_CORNER_Y;

        //
        // Set the traversal depth based on the pen tool.
        //
        *pulZ = PEN_TRAVERSE;

        //
        // Set the drawing depth based on the pen tool.
        //
        *pulDepth = PEN_DEPTH;

        //
        // Only do a single iteration with the pen.
        //
        *pulIterations = 1;

        //
        // Set the drawing speed.
        //
        DrawSetDrawSpeed(2400, 30000);

        //
        // Set the traversal speed.
        //
        DrawSetTraverseSpeed(2400, 30000);

        //
        // Set the Z axis speed.
        //
        DrawSetZSpeed(1200, 30000);
    }

    //
    // Otherwise, the router is the selected tool.
    //
    else
    {
        //
        // Set the workpiece corner based on the router tool.
        //
        *pulX = ROUTER_CORNER_X;
        *pulY = ROUTER_CORNER_Y;

        //
        // Set the traversal depth based on the router tool.
        //
        *pulZ = ROUTER_TRAVERSE;

        //
        // Set the drawing depth based on the router tool.
        //
        *pulDepth = ROUTER_DEPTH;

        //
        // Select the number of iterations based on the requested depth.
        //
        *pulIterations = (g_ulTool & 0x0f) + 1;

        //
        // Set the drawing speed.
        //
        DrawSetDrawSpeed(300, 30000);

        //
        // Set the traversal speed.
        //
        DrawSetTraverseSpeed(2400, 30000);

        //
        // Set the Z axis speed.
        //
        DrawSetZSpeed(1200, 30000);
    }
}

//*****************************************************************************
//
//! Delays for a period of time.
//!
//! \param ulMilliseconds is the number of milliseconds to delay.
//!
//! This function delays for a given period of time.  The count of milliseconds
//! to delay can not exceed 2^32 / (system clock / 1000) or the delay will be
//! much shorter than expected; in practice this isn't typically a problem
//! since this equates to 85.899 seconds for a 50 MHz processor clock.
//!
//! \return None.
//
//*****************************************************************************
static void
DemoDelay(unsigned long ulMilliseconds)
{
    unsigned long ulNow;

    //
    // Get the present time.
    //
    ulNow = VirtualTimeGet();

    //
    // Loop until the given time has passed.
    //
    while((VirtualTimeGet() - ulNow) <
          ((g_ulSysClock / 1000) * ulMilliseconds))
    {
    }
}

//*****************************************************************************
//
//! Performs the first CNC demonstration.
//!
//! This demonstration of the CNC machine draws an optional logo and the
//! supplied string stacked on top of each other.  It is intended to be used
//! with a pen and a piece of paper approximately five inches (12.7 cm) square.
//! The text is drawn a quarter inch (0.6 cm) tall, and the logo is drawn one
//! inch (2.54 cm) tall.
//!
//! \return None.
//
//*****************************************************************************
void
Demo1(void)
{
    unsigned long ulX, ulY, ulZ, ulDepth, ulIterations, ulXS, ulYS;
    long lIconHeight, lIconWidth, lStringWidth, lYMin, lYMax;

    //
    // Setup the tool for this demo.
    //
    DemoSetupTool(&ulX, &ulY, &ulZ, &ulDepth, &ulIterations);

    //
    // Get the extents of the name string.
    //
    if(g_pcNameString[0] != '\0')
    {
        DrawGetStringSize(g_pcNameString, INCHES(0, 250), &lStringWidth,
                          &lYMin, &lYMax);
    }
    else
    {
        lStringWidth = 0;
        lYMin = 0;
        lYMax = 0;
    }

    //
    // Get the size of the icon.
    //
    if(g_ulIcons & 0x01)
    {
        lIconWidth = DrawGetImageWidth(g_pusLMI, INCHES(1, 000));
        lIconHeight = INCHES(1, 000);
    }
    else if(g_ulIcons & 0x02)
    {
        lIconWidth = DrawGetImageWidth(g_pusARM, INCHES(1, 000));
        lIconHeight = INCHES(1, 000);
    }
    else
    {
        lIconWidth = INCHES(0, 000);
        lIconHeight = INCHES(0, 000);
    }

    //
    // If there is a name string and an icon, then add the 1/4 inch (0.6 cm)
    // gap between the two to the height of the string.
    //

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国产精品99精品国产| 国产精品国产三级国产aⅴ无密码| 欧美精品日韩一区| 久久先锋资源网| 国产精品免费aⅴ片在线观看| 亚洲一区二区精品3399| 狠狠色狠狠色综合系列| 91在线观看污| 色婷婷av一区二区三区gif | 亚洲日本在线天堂| 久久精品72免费观看| 欧美精品一区二区在线观看| 亚洲一区二区综合| 欧美一区二区播放| 亚洲精品视频观看| 成人午夜av电影| 欧美一区二区三区在线看| 久久国产精品99久久人人澡| 欧美国产97人人爽人人喊| 首页国产欧美日韩丝袜| 91在线观看视频| 成人免费高清在线观看| 欧美国产成人在线| 欧美亚洲动漫精品| 国产精品福利av| 欧美日韩精品一区二区三区| 樱桃视频在线观看一区| 宅男噜噜噜66一区二区66| 一区二区三区在线视频免费观看| 成人一道本在线| 亚洲国产视频一区二区| 欧美三级电影在线看| 一区二区三区精品| 亚洲精品一线二线三线| 一本大道av一区二区在线播放 | 国产精品视频麻豆| 欧洲精品在线观看| 一区二区三区中文字幕| 精品国偷自产国产一区| 91久久线看在观草草青青| 亚洲乱码日产精品bd| 日韩欧美自拍偷拍| 久久精品国产色蜜蜜麻豆| 中文字幕一区二区在线观看| 91在线观看视频| 国产一区二区不卡在线| 久久久午夜电影| 懂色av一区二区三区免费观看| 国产精品美女久久久久久久久久久 | 久久精品一区蜜桃臀影院| 国产精品自拍毛片| 国产精品久久久久影院| 欧美第一区第二区| 成人h版在线观看| 亚洲图片另类小说| 国产无遮挡一区二区三区毛片日本| 欧美日韩你懂得| 北岛玲一区二区三区四区| 一区二区三区四区亚洲| 国产欧美精品一区二区色综合朱莉 | 国产成人亚洲综合a∨猫咪| 男人的j进女人的j一区| 欧美不卡视频一区| 国产激情一区二区三区四区| 日韩福利电影在线| 国产亚洲一区二区三区在线观看| 欧美情侣在线播放| 欧美日韩中文另类| 在线国产电影不卡| 日本精品视频一区二区三区| 成人国产在线观看| 国产精品1024| 久久99精品久久久久久| 中文字幕在线免费不卡| 国产欧美一区二区三区鸳鸯浴 | 国产清纯白嫩初高生在线观看91 | 欧美日韩一区视频| 色噜噜狠狠一区二区三区果冻| av在线综合网| 99精品欧美一区二区蜜桃免费 | 美女高潮久久久| 国产精品妹子av| 中文天堂在线一区| 国产精品久久一级| 亚洲视频在线一区| 亚洲色图视频网| 亚洲精品免费看| 亚洲国产精品天堂| 午夜精品福利一区二区三区av| 久久久久久久久久看片| 久久久久国产免费免费| 国产日韩欧美一区二区三区乱码| 久久久www成人免费无遮挡大片| 亚洲精品一区二区三区四区高清| 精品国产1区二区| 久久久久国产精品麻豆ai换脸| 久久精品一区二区三区av| 国产拍揄自揄精品视频麻豆| 中文字幕久久午夜不卡| 亚洲欧美日韩一区二区| 日本一区二区免费在线观看视频| 国产清纯在线一区二区www| 自拍偷拍亚洲综合| 亚洲v中文字幕| 亚洲欧美区自拍先锋| 亚洲国产欧美在线| 免费观看91视频大全| 国产福利电影一区二区三区| 91亚洲精品乱码久久久久久蜜桃| 欧美在线三级电影| 精品国产一区二区三区久久影院| 国产欧美日韩久久| 亚洲小说春色综合另类电影| 蜜桃视频一区二区三区在线观看| 国产精品亚洲综合一区在线观看| 99精品视频一区| 欧美一级在线免费| 中文字幕av一区二区三区高| 亚洲午夜精品在线| 国产精品综合av一区二区国产馆| 91老师国产黑色丝袜在线| 在线不卡的av| 国产精品丝袜一区| 日本不卡不码高清免费观看| 成人av中文字幕| 91麻豆精品国产91久久久久久| 国产嫩草影院久久久久| 亚洲电影你懂得| 国产成人av网站| 欧美另类一区二区三区| 国产精品久久久久永久免费观看| 午夜精彩视频在线观看不卡| 成人免费毛片嘿嘿连载视频| 欧美一区二区三区精品| 亚洲三级在线免费观看| 激情丁香综合五月| 欧美日韩精品一区二区三区四区 | 亚洲人123区| 国产资源精品在线观看| 欧美日韩日日骚| 国产精品色婷婷久久58| 91丨九色porny丨蝌蚪| 欧美va亚洲va香蕉在线| 亚洲成人免费在线观看| a美女胸又www黄视频久久| 日韩一区二区中文字幕| 亚洲综合成人在线| 99精品视频一区| 国产精品青草综合久久久久99| 久久国产日韩欧美精品| 8x福利精品第一导航| 亚洲资源中文字幕| 一本色道久久综合亚洲精品按摩 | 综合久久久久久| 国产91精品露脸国语对白| 欧美成人一区二区| 麻豆精品一区二区| 日韩一级大片在线观看| 亚洲www啪成人一区二区麻豆| 91黄色在线观看| 亚洲精品日产精品乱码不卡| 暴力调教一区二区三区| 日本一区二区动态图| 国产mv日韩mv欧美| 国产日本欧洲亚洲| 成人免费视频caoporn| 欧美激情一区二区三区四区 | 国产精品美女久久久久av爽李琼| 国内外精品视频| 久久五月婷婷丁香社区| 国产麻豆91精品| 国产欧美日韩视频一区二区 | 美国欧美日韩国产在线播放| 欧美中文字幕一区| 亚洲一区二区中文在线| 欧美另类一区二区三区| 日本va欧美va精品发布| 日韩一二三区视频| 欧美日韩一区二区不卡| 亚洲1区2区3区视频| 91精品国产色综合久久| 麻豆91精品视频| 精品对白一区国产伦| 国产成人av一区二区三区在线 | 日韩欧美你懂的| 国内精品在线播放| 中文子幕无线码一区tr| av成人动漫在线观看| 亚洲一区二区在线观看视频| 欧美三片在线视频观看| 蜜桃视频免费观看一区| 国产视频一区在线观看 | 久久精品人人爽人人爽| 成人免费毛片片v| 一区二区三区不卡在线观看 | 亚洲欧洲美洲综合色网| 欧美性猛交xxxxxxxx| 日本午夜一本久久久综合| 久久综合久久综合亚洲| 91在线你懂得|