![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Making POV public for LVC Robot Club
main.cpp@0:4623833eae96, 2011-10-10 (annotated)
- Committer:
- jonmarsh
- Date:
- Mon Oct 10 10:21:25 2011 +0000
- Revision:
- 0:4623833eae96
Says \"Hello\"
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jonmarsh | 0:4623833eae96 | 1 | #include "mbed.h" |
jonmarsh | 0:4623833eae96 | 2 | #include "m3pi.h" |
jonmarsh | 0:4623833eae96 | 3 | |
jonmarsh | 0:4623833eae96 | 4 | m3pi m3pi(p23,p9,p10); |
jonmarsh | 0:4623833eae96 | 5 | |
jonmarsh | 0:4623833eae96 | 6 | char pov[30] = { |
jonmarsh | 0:4623833eae96 | 7 | |
jonmarsh | 0:4623833eae96 | 8 | 0x7f,0x08,0x08,0x08,0x7f,0x0, // H |
jonmarsh | 0:4623833eae96 | 9 | 0x7f,0x49,0x49,0x41,0x41,0x0, // E |
jonmarsh | 0:4623833eae96 | 10 | 0x00,0x7f,0x01,0x01,0x01,0x0, // L |
jonmarsh | 0:4623833eae96 | 11 | 0x00,0x7f,0x01,0x01,0x01,0x0, // L |
jonmarsh | 0:4623833eae96 | 12 | 0x3e,0x41,0x41,0x41,0x3e,0x0, // O |
jonmarsh | 0:4623833eae96 | 13 | |
jonmarsh | 0:4623833eae96 | 14 | }; |
jonmarsh | 0:4623833eae96 | 15 | |
jonmarsh | 0:4623833eae96 | 16 | |
jonmarsh | 0:4623833eae96 | 17 | int main() { |
jonmarsh | 0:4623833eae96 | 18 | |
jonmarsh | 0:4623833eae96 | 19 | m3pi.locate(0,1); |
jonmarsh | 0:4623833eae96 | 20 | m3pi.printf("m3pi PoV"); |
jonmarsh | 0:4623833eae96 | 21 | |
jonmarsh | 0:4623833eae96 | 22 | wait(2.0); |
jonmarsh | 0:4623833eae96 | 23 | |
jonmarsh | 0:4623833eae96 | 24 | m3pi.right(1.0); // spin full speed right! |
jonmarsh | 0:4623833eae96 | 25 | |
jonmarsh | 0:4623833eae96 | 26 | while (1) { |
jonmarsh | 0:4623833eae96 | 27 | |
jonmarsh | 0:4623833eae96 | 28 | for (int i=0;i<30;i++) { |
jonmarsh | 0:4623833eae96 | 29 | m3pi.leds(pov[i]); |
jonmarsh | 0:4623833eae96 | 30 | wait(0.005); |
jonmarsh | 0:4623833eae96 | 31 | } |
jonmarsh | 0:4623833eae96 | 32 | |
jonmarsh | 0:4623833eae96 | 33 | |
jonmarsh | 0:4623833eae96 | 34 | wait (0.1); |
jonmarsh | 0:4623833eae96 | 35 | } |
jonmarsh | 0:4623833eae96 | 36 | } |