main.cpp

Committer:
kagyroy
Date:
2011-12-31
Revision:
1:0a67babd7786
Parent:
0:1cc4593f62e2

File content as of revision 1:0a67babd7786:

#include "include_file.h"

int main( int argc, char **argv )
{
    int width,height,color;   
    device.baud( 115200 );
//    device.baud( 9600 );
    right_pwm.period_us( 10 );
    left_pwm.period_us( 10 );
    enable.write( 1 );
    
  //  device.putc('s');

   wait( 2 );
 /*
   int tempo;
   for(int i=0; i<10; i++)
   {
       for(int j=0; j<10; j++)
       {
           tempo = 0;
           device.printf("a");
       }
   } 
 */
#define WIDTH 100
#define HEIGHT 100

width = 0;
while(1){

   device.printf("s"); //'s'tart signal 
//   device.printf("%d",WIDTH*HEIGHT); //declaring number of byte(related to frame size)
//   device.printf("e");  //declare 'e'nd
   for(int i=0; i<WIDTH; i++)
   {
        for(int j=0; j<HEIGHT; j++)
        {
           ++width;
           device.printf("%d\n",width);
           if(width>=255) width = 0;
        }   
        device.printf("h"); //'h'ref: change row
   }
   device.printf("t");  //s't'op: frame show enable
}
while(1);
/*
   int frame[200][200][3];

   for(int i=0; i<200; i++)
   {
       for(int j=0; j<200; j++)
       {
           frame[i][j][0] = 100;
           frame[i][j][1] = 100;
           frame[i][j][2] = 100;
       }
   }    
 
    while(1)
    {       
       for(int i=0; i<200; i++)
       {
           for(int j=0; j<200; j++)
           {
               device.printf("%d\n",frame[i][j][0]);

               wait_ms( 50 );
           }
       }
    }
*/   
/*
   device.printf("s");  //start chara
   for(int i=0; i<200; i++)
   {
       for(int j=0; j<200; j++)
       {
            device.printf("%d\n",frame[i][j][0]);
       }
       device.printf("h");  //horizontal transition
   }
   device.printf("e");  //vertical end
 */  
    
}