I am trying to figure out how to do the following:
int xcoor=0, ycoor=0, hstep, vstep;
while true do
{
update_step(hstep, vstep); // essentially have a big while loop to generate the necessary hstep/vsteps
xcoor = xcoor + hstep; // I need to add a new hstep to the xcoor
ycoor = ycoor + vstep; // I need to add a new vstep to the ycoor
updategraph(xcoor, ycoor); // and feed the updated xcoor/ycoor to an XYgraph
}
I think I should use a Master/Slave design? but how do I keep the previous value the first time in the Slave and then add the new values to the stored value??