欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
stm32-gbrl-g代碼解釋程序
[打印本頁]
作者:
asd150080
時間:
2018-3-19 16:03
標題:
stm32-gbrl-g代碼解釋程序
stm32-gbrl-g代碼解釋程序
單片機源程序如下:
/***************************************************************/
//2013.8.27 Copyright@ rhyme呆瓜云
/***************************************************************/
#include "stm32f10x.h"
#include "stdio.h"
#include "gpio.h"
#include "usart.h"
#include "delay.h"
#include "tim.h"
#include "eeprom.h"
#include "pwm.h"
#include "config.h"
#include "planner.h"
#include "nuts_bolts.h"
#include "stepper.h"
#include "spindle_control.h"
#include "coolant_control.h"
#include "motion_control.h"
#include "gcode.h"
#include "protocol.h"
#include "limits.h"
#include "report.h"
#include "settings.h"
#include "serial.h"
/***************************************************************/
u8 USART_RX[60]={""};
u8 USART_mark=0;
u8 Press_mark=0;
int USART_control=0;
int USART_data=0;
u16 USART_RX_STA; //接收狀態(tài)標記
uint16_t ee;//EEPROM變量
u8 mo=1;
/***************************************************************/
int main(void)
{
RCC_Configuration();
delay_Configuration(72);
USART1_Configuration(9600);
PB9_OUT
Set_B9
// PB8_OUT
// Set_B8
// delay_ms(200);
// Clr_B8
// delay_ms(200);
// Set_B8
// delay_ms(300);
// Clr_B8
// PA7_OUT
// Clr_A7
//
// PA6_OUT
// Clr_A6
Motors_Set_GPIO();//電機IO口定義
// FLASH_Unlock();
// EE_Init();
settings_reset(true);//GRBL重置所有參數(shù)
//讀取EEPROM 設(shè)定FEED和SEEK
// if(!EE_ReadVariable(32,&ee))
// {
// settings.default_feed_rate = ee;
// settings.default_seek_rate = ee;
// }
TIM_Configuration(TIM2,1001,1,1);
st_init(); //步進電機初始化,用這兩個中斷,通過 “布雷森漢姆直線算法”同時控制三個步進輸出。
memset(&sys, 0, sizeof(sys)); //清數(shù)組
sys.abort = true; // 設(shè)置abort 標志著初始化完成
sys.state = STATE_INIT; // 設(shè)置一個警示標志來指示未知的初始位置
// TIM3_PWM_Configuration(20,3600,1,1,0,0);
// PA6_OUT
// Set_A6
// PA7_OUT
// Clr_A7
while(1)
{
if (sys.abort) {
// Reset system.
serial_reset_read_buffer(); // Clear serial read buffer
plan_init(); // Clear block buffer and planner variables
gc_init(); // Set g-code parser to default state
protocol_init(); // Clear incoming line data and execute startup lines
spindle_init();
coolant_init();
limits_init();
st_reset(); // Clear stepper subsystem variables.
// Sync cleared gcode and planner positions to current system position, which is only
// cleared upon startup, not a reset/abort.
sys_sync_current_position();
// Reset system variables.
sys.abort = false;
sys.execute = 0;
if (bit_istrue(settings.flags,BITFLAG_AUTO_START)) { sys.auto_start = true; }
// Check for power-up and set system alarm if homing is enabled to force homing cycle
// by setting Grbl's alarm state. Alarm locks out all g-code commands, including the
// startup scripts, but allows access to settings and internal commands. Only a homing
// cycle '$H' or kill alarm locks '$X' will disable the alarm.
// NOTE: The startup script will run after successful completion of the homing cycle, but
// not after disabling the alarm locks. Prevents motion startup blocks from crashing into
// things uncontrollably. Very bad.
#ifdef HOMING_INIT_LOCK
if (sys.state == STATE_INIT && bit_istrue(settings.flags,BITFLAG_HOMING_ENABLE)) { sys.state = STATE_ALARM; }
#endif
// Check for and report alarm state after a reset, error, or an initial power up.
if (sys.state == STATE_ALARM) {
report_feedback_message(MESSAGE_ALARM_LOCK);
} else {
// All systems go. Set system to ready and execute startup script.
sys.state = STATE_IDLE;
protocol_execute_startup();
}
}
protocol_execute_runtime();
protocol_process(); // ... process the serial protocol
if(mo==0) {MotorsEnable(0x00);mo=10;}
// delay_ms(500);
// Set_B12
// delay_ms(500);
// Clr_B12
// printf(" This is the STM32 Demo !!! \r\n");
}
}
/***************************************************************/
復(fù)制代碼
所有資料51hei提供下載:
STM32-GRBL-master.rar
(412.7 KB, 下載次數(shù): 176)
2018-3-19 16:03 上傳
點擊文件名下載附件
g代碼解釋器
下載積分: 黑幣 -5
作者:
mamingle666
時間:
2018-5-17 11:04
謝謝分享
作者:
mick32
時間:
2018-5-26 05:01
Nice work
Thanks
作者:
yibunihao
時間:
2018-12-8 10:50
多謝樓主分享
作者:
swapkernel1
時間:
2018-12-19 08:39
多謝樓主分享
作者:
肥佬的黑貓
時間:
2018-12-24 10:44
謝謝分享
作者:
Poker_
時間:
2019-4-17 20:31
樓主,你13行到25行的代碼都指的啥呀
作者:
WGY116
時間:
2020-2-3 17:40
感謝分享
作者:
cnc2020
時間:
2020-2-6 22:27
very good, thank you
作者:
yulin3192
時間:
2022-7-10 10:36
謝謝分享,啥時候能發(fā)個文檔
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1