Code

Create variables for the start and end points of the line, as well as variables to hold the locations for the previous time through the loop(). You'll use these values to erase lines when it changes position.

In loop(), read the value from the accelerometer's x-axis. This is the axis oriented to the horizon when the Esplora is held in front of your face, perpendicular to the earth. Map the values from the accelerometer so that the line's starting point is between 0 and the screen's height. To find the end point, invert the output values

Compare the current beginning and end points to the values from the previous time through loop(). If they are different, erase the line drawn previously. Then, draw the line in its new location, based on the mapped values.