I make a plotter with Repetier.
The plotter shall make just radomly dots in an area.
my idea:
void Custom_500MS()
{
//in random mode Plotter checks Buffer if the buffer is smaller than 5, then start new commands for dot
if (Plotter::RandomMode>0 and PrintLine::linesCount < 5 ){
PlotRandomMode();
}
}
//function
void PlotRandomMode() {
//plotterstart
if (Plotter::RandomMode ==1){
GCode::executeFString(PSTR("M5"));
GCode::executeFString(PSTR("G28"));
GCode::executeFString(PSTR("G90")); //absolut
Plotter::RandomMode = 2;
}
//punkt suchen
float x=random(100000);float y=random(100000); //x,y plot area by 1000
x=x/1000; y=y/1000;
PlotMuster(x,y);
}
// plotter just pendown and penup
void PlotMuster(float x, float y) {
String temp="G1 X" + String(x,3) + " Y" + String(y,3);
GCode::executeFString(PSTR(temp)); //<-- here is my problem
GCode::executeFString(PSTR("M3"));
//stift absetzen also nur punkt machen - just a dot
delay(100);//100 millisekunden stift untenlassen
GCode::executeFString(PSTR("M5"));
}
sorry for my poor programming knowledge:
PSTR gives back the pointer
what do I have to do, to bring the String variable temp into the PSTR function??
Thanks for help!