Monday, October 24, 2011

Pythagoras: Sending Data to the Microcontroller

All these points and nothing to do with them? Why, stream them to the microcontroller!

The Protocol

Nothing special. Microcontroller requests a new point, computer sends a new point. If there are no new points, computer sends an end transmission code.
The microcontroller also buffers a set of points. Currently, it is set to store 256 points before requesting more. Pretty arbitrary. So the program flow is:

while stop flag not set
  If buffer is empty
    reload buffer
     if received end transmission
       set stop flag
  draw all points in buffer

One More Thing

The Z height needs to be adjustable. Get a couple buttons to adjust the drawing height, so the pen touches, not misses or jams into, the paper.

With that done, its picture time!
Complete with documentary quality commentary.