HI ,
I have tryed a stupid simple module like :
#include "libs/Module.h" #include "libs/Kernel.h" #include "libs/SerialMessage.h" #include "SimpleKeyboard.h" #include "libs/Pin.h"SimpleKeyboard::SimpleKeyboard(){}
void SimpleKeyboard::on_module_loaded(){
this->xinc.from_string(“0.10v”)->as_input();
this->kernel->slow_ticker->attach( 100, this, &SimpleKeyboard::keyboard_tick );
}//TODO: Make this use InterruptIn
//Check the state of the button and act accordingly
uint32_t SimpleKeyboard::keyboard_tick(uint32_t dummy){
this->send_command=false;if(this->xinc.get() == true) { //this->g_code = "G1 X100"; this->send_command = true; this->kernel->streams->printf("Trimit comanda \r\n"); } return 0;}
But when I push that button I got an error like :
$T050c:884f0010;0d:407f0010;0e:fd570200;0f:22160200;#f1
What I did wrong ?
in main.cpp I have added :
... #include "modules/tools/SimpleKeyboard/SimpleKeyboard.h"; ....kernel->add_module( new SimpleKeyboard() );…
Imported from wikidot