Yuichi Kawamura
/
evorobo
main.cpp@1:0a67babd7786, 2011-12-31 (annotated)
- Committer:
- kagyroy
- Date:
- Sat Dec 31 05:22:18 2011 +0000
- Revision:
- 1:0a67babd7786
- Parent:
- 0:1cc4593f62e2
temporary saved project for transmitting to pc
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kagyroy | 0:1cc4593f62e2 | 1 | #include "include_file.h" |
kagyroy | 0:1cc4593f62e2 | 2 | |
kagyroy | 0:1cc4593f62e2 | 3 | int main( int argc, char **argv ) |
kagyroy | 0:1cc4593f62e2 | 4 | { |
kagyroy | 1:0a67babd7786 | 5 | int width,height,color; |
kagyroy | 0:1cc4593f62e2 | 6 | device.baud( 115200 ); |
kagyroy | 1:0a67babd7786 | 7 | // device.baud( 9600 ); |
kagyroy | 0:1cc4593f62e2 | 8 | right_pwm.period_us( 10 ); |
kagyroy | 0:1cc4593f62e2 | 9 | left_pwm.period_us( 10 ); |
kagyroy | 0:1cc4593f62e2 | 10 | enable.write( 1 ); |
kagyroy | 0:1cc4593f62e2 | 11 | |
kagyroy | 1:0a67babd7786 | 12 | // device.putc('s'); |
kagyroy | 1:0a67babd7786 | 13 | |
kagyroy | 1:0a67babd7786 | 14 | wait( 2 ); |
kagyroy | 1:0a67babd7786 | 15 | /* |
kagyroy | 1:0a67babd7786 | 16 | int tempo; |
kagyroy | 1:0a67babd7786 | 17 | for(int i=0; i<10; i++) |
kagyroy | 1:0a67babd7786 | 18 | { |
kagyroy | 1:0a67babd7786 | 19 | for(int j=0; j<10; j++) |
kagyroy | 1:0a67babd7786 | 20 | { |
kagyroy | 1:0a67babd7786 | 21 | tempo = 0; |
kagyroy | 1:0a67babd7786 | 22 | device.printf("a"); |
kagyroy | 1:0a67babd7786 | 23 | } |
kagyroy | 1:0a67babd7786 | 24 | } |
kagyroy | 1:0a67babd7786 | 25 | */ |
kagyroy | 1:0a67babd7786 | 26 | #define WIDTH 100 |
kagyroy | 1:0a67babd7786 | 27 | #define HEIGHT 100 |
kagyroy | 0:1cc4593f62e2 | 28 | |
kagyroy | 1:0a67babd7786 | 29 | width = 0; |
kagyroy | 1:0a67babd7786 | 30 | while(1){ |
kagyroy | 1:0a67babd7786 | 31 | |
kagyroy | 1:0a67babd7786 | 32 | device.printf("s"); //'s'tart signal |
kagyroy | 1:0a67babd7786 | 33 | // device.printf("%d",WIDTH*HEIGHT); //declaring number of byte(related to frame size) |
kagyroy | 1:0a67babd7786 | 34 | // device.printf("e"); //declare 'e'nd |
kagyroy | 1:0a67babd7786 | 35 | for(int i=0; i<WIDTH; i++) |
kagyroy | 1:0a67babd7786 | 36 | { |
kagyroy | 1:0a67babd7786 | 37 | for(int j=0; j<HEIGHT; j++) |
kagyroy | 1:0a67babd7786 | 38 | { |
kagyroy | 1:0a67babd7786 | 39 | ++width; |
kagyroy | 1:0a67babd7786 | 40 | device.printf("%d\n",width); |
kagyroy | 1:0a67babd7786 | 41 | if(width>=255) width = 0; |
kagyroy | 1:0a67babd7786 | 42 | } |
kagyroy | 1:0a67babd7786 | 43 | device.printf("h"); //'h'ref: change row |
kagyroy | 1:0a67babd7786 | 44 | } |
kagyroy | 1:0a67babd7786 | 45 | device.printf("t"); //s't'op: frame show enable |
kagyroy | 1:0a67babd7786 | 46 | } |
kagyroy | 1:0a67babd7786 | 47 | while(1); |
kagyroy | 1:0a67babd7786 | 48 | /* |
kagyroy | 0:1cc4593f62e2 | 49 | int frame[200][200][3]; |
kagyroy | 0:1cc4593f62e2 | 50 | |
kagyroy | 0:1cc4593f62e2 | 51 | for(int i=0; i<200; i++) |
kagyroy | 0:1cc4593f62e2 | 52 | { |
kagyroy | 0:1cc4593f62e2 | 53 | for(int j=0; j<200; j++) |
kagyroy | 0:1cc4593f62e2 | 54 | { |
kagyroy | 0:1cc4593f62e2 | 55 | frame[i][j][0] = 100; |
kagyroy | 0:1cc4593f62e2 | 56 | frame[i][j][1] = 100; |
kagyroy | 0:1cc4593f62e2 | 57 | frame[i][j][2] = 100; |
kagyroy | 0:1cc4593f62e2 | 58 | } |
kagyroy | 0:1cc4593f62e2 | 59 | } |
kagyroy | 0:1cc4593f62e2 | 60 | |
kagyroy | 0:1cc4593f62e2 | 61 | while(1) |
kagyroy | 0:1cc4593f62e2 | 62 | { |
kagyroy | 0:1cc4593f62e2 | 63 | for(int i=0; i<200; i++) |
kagyroy | 0:1cc4593f62e2 | 64 | { |
kagyroy | 0:1cc4593f62e2 | 65 | for(int j=0; j<200; j++) |
kagyroy | 0:1cc4593f62e2 | 66 | { |
kagyroy | 0:1cc4593f62e2 | 67 | device.printf("%d\n",frame[i][j][0]); |
kagyroy | 0:1cc4593f62e2 | 68 | |
kagyroy | 0:1cc4593f62e2 | 69 | wait_ms( 50 ); |
kagyroy | 0:1cc4593f62e2 | 70 | } |
kagyroy | 0:1cc4593f62e2 | 71 | } |
kagyroy | 0:1cc4593f62e2 | 72 | } |
kagyroy | 1:0a67babd7786 | 73 | */ |
kagyroy | 0:1cc4593f62e2 | 74 | /* |
kagyroy | 0:1cc4593f62e2 | 75 | device.printf("s"); //start chara |
kagyroy | 0:1cc4593f62e2 | 76 | for(int i=0; i<200; i++) |
kagyroy | 0:1cc4593f62e2 | 77 | { |
kagyroy | 0:1cc4593f62e2 | 78 | for(int j=0; j<200; j++) |
kagyroy | 0:1cc4593f62e2 | 79 | { |
kagyroy | 0:1cc4593f62e2 | 80 | device.printf("%d\n",frame[i][j][0]); |
kagyroy | 0:1cc4593f62e2 | 81 | } |
kagyroy | 0:1cc4593f62e2 | 82 | device.printf("h"); //horizontal transition |
kagyroy | 0:1cc4593f62e2 | 83 | } |
kagyroy | 0:1cc4593f62e2 | 84 | device.printf("e"); //vertical end |
kagyroy | 0:1cc4593f62e2 | 85 | */ |
kagyroy | 1:0a67babd7786 | 86 | |
kagyroy | 0:1cc4593f62e2 | 87 | } |
kagyroy | 1:0a67babd7786 | 88 |