注释
|
@algo1980:Grbl 不使用任何 Arduino 代码,如果您尝试使用,它会中断。它仅使用 IDE 作为编译和刷新它的工具。您将只需要编辑和编写 Grbl 源代码。避免任何 Arduino 函数调用。 |
|
感谢您的快速回复。 |
|
什么是 IO 异常错误? |
|
那不是编译错误。某些文件无法访问或上传时串口错误。2017-05-17 17:45 GMT-03:00 algo1980 <notifications@github.com>:
|
|
我尝试添加 .h 和 .cpp。编译时说无法上传.. 怎么了? |
|
无论我在做什么,它都会返回一个错误 |
|
@algo1980 no one can assist you if you don’t provide more information on what you’re actually doing. You will need to explain what version of grbl you are using, what version of Arduino, what platform you’re compiling on and the hardware you are targeting. You also need to show some code and provide error messages. Just saying “it could not upload” or “it returns with an error” doesn’t get us anywhere! |
|
using grbl0.9e on atmega 2560. i am trying to add the lcd.cpp and lcd.h to the whole set of grbl files, but it fails to compile it. here is the code im adding /////////////////lcd.cpp #include <inttypes.h> // commands // flags for display entry mode // flags for display on/off control // flags for display/cursor shift // flags for function set class LiquidCrystal : public Print { void init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable, void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS); void clear(); void noDisplay(); void setRowOffsets(int row1, int row2, int row3, int row4); using Print::write; uint8_t _rs_pin; // LOW: command. HIGH: character. uint8_t _displayfunction; uint8_t _initialized; uint8_t _numlines; #endif and here is the header which i am using lcd.h #include <inttypes.h> // commands // flags for display entry mode // flags for display on/off control // flags for display/cursor shift // flags for function set class LiquidCrystal : public Print { void init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable, void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS); void clear(); void noDisplay(); void setRowOffsets(int row1, int row2, int row3, int row4); using Print::write; uint8_t _rs_pin; // LOW: command. HIGH: character. uint8_t _displayfunction; uint8_t _initialized; uint8_t _numlines; #endif |
|
Should we assume that you are asking us to compile this and figure it out? You need to learn how to write a problem report/defect/issue that provides enough information to help you, otherwise we are left playing ’20 questions’ which some us (me in particular) have no patience for after 40+ years in sw development. |
|
@algo1980 : Grbl does not use the Arduino IDE libraries and is all custom written for CNC control to optimize performance and efficiency. It will break if you try to use them with Grbl’s source code. It only uses the IDE as a vehicle to easily compile and flash Grbl to an Arduino. If you want to add something, you’ll have to figure out how to use Arduino libraries with Grbl (not easy), find libraries that have no dependencies, or write them yourself. With Grbl’s new HAL that is soon to be released, I’m hoping that I can make it easier to use existing libraries with Grbl, but it’s not guaranteed. |
|
感谢 chamnit,这对像我这样的许多初学者来说将是一个很大的帮助。我对新的 HAL 感到很兴奋。并希望快速启动。顺便说一句,它是一个非常智能的代码。我必须补充作者。 |
|
cham 是否有可能我仅将 arduino lib 用作参考并声明我自己的函数? |


您好,我正在尝试添加一个简单的代码,但在编辑后无法编译代码。有人可以建议发生了什么事。