Thread: the main code
View Single Post
  #10   Spotlight this post!  
Unread 09-01-2008, 15:40
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
Re: the main code

A movie is made up of a series of still images that give the appearance of continuous motion. The robot controller works like that: each pass through the loop (that statusflag.NEW_SPI_DATA == 1) is like a new movie frame. A snapshot is taken of the input data and processed by your code, then the controller takes a snapshot of your output values and sends them to the robot.

If the loop stops it would be like stopping a movie. You'd get a frozen frame, or a robot with a frozen set of output values. That while( TRUE ) loop is the crank that keeps the movie going.
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.