Inspired by Mr. Jeff G.'s Mini Project LCD Maze, I hacked my version for FRDM-KL25Z. This one utilizes the MMA8451Q on the FRDM and my vt100 lib. By editing "maze.h" you can create your own maze.
Dependencies: MMA8451Q mbed vt100
Another sample project to show how to use my vt100 lib along with MMA8451Q lib.
You can tailor the maze by editing "maze.h."
先にパブリッシュした vt100 ライブラリと、FRDM-KL25Zに搭載された加速度センサを使用した簡単な迷路プログラムです。
“maze.h” を編集することで独自の迷路を作成していただけます。
After download and reset, the point "@" is located at the start point. Goal is the green "G."
ダウンロードしてリセットすると、画面のスタート位置に“@”が置かれます。 ゴールは緑色の“G”です。
Move the FRDM-KL25Z board to let the "@" go.
FRDM-KL25Z を動かして、“@”を移動させます。
When "@" arrives at the goal with the "goal" banner, game ends.
“@”がゴールにたどり着くと“goal”というバナーが出てゲーム終了です。
maze.h@0:f2f2c76b9816, 2014-12-07 (annotated)
- Committer:
- Rhyme
- Date:
- Sun Dec 07 10:17:42 2014 +0000
- Revision:
- 0:f2f2c76b9816
First time commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Rhyme | 0:f2f2c76b9816 | 1 | #ifndef _MAZE_H_ |
Rhyme | 0:f2f2c76b9816 | 2 | #define _MAZE_H_ defined |
Rhyme | 0:f2f2c76b9816 | 3 | |
Rhyme | 0:f2f2c76b9816 | 4 | #define MAZE_W 20 |
Rhyme | 0:f2f2c76b9816 | 5 | #define MAZE_H 20 |
Rhyme | 0:f2f2c76b9816 | 6 | |
Rhyme | 0:f2f2c76b9816 | 7 | #define POS_PATH 0 |
Rhyme | 0:f2f2c76b9816 | 8 | #define POS_WALL 1 |
Rhyme | 0:f2f2c76b9816 | 9 | #define POS_START 2 |
Rhyme | 0:f2f2c76b9816 | 10 | #define POS_GOAL 3 |
Rhyme | 0:f2f2c76b9816 | 11 | |
Rhyme | 0:f2f2c76b9816 | 12 | uint8_t maze[MAZE_H][MAZE_W] = { |
Rhyme | 0:f2f2c76b9816 | 13 | {1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, |
Rhyme | 0:f2f2c76b9816 | 14 | {1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, |
Rhyme | 0:f2f2c76b9816 | 15 | {1,0,1,0,1,0,1,1,1,1,0,1,1,1,1,1,1,1,0,1}, |
Rhyme | 0:f2f2c76b9816 | 16 | {1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,1,0,1}, |
Rhyme | 0:f2f2c76b9816 | 17 | {1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,1,0,1}, |
Rhyme | 0:f2f2c76b9816 | 18 | {1,0,0,0,1,0,1,0,1,0,0,0,0,0,1,0,1,1,0,1}, |
Rhyme | 0:f2f2c76b9816 | 19 | {1,0,1,1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1}, |
Rhyme | 0:f2f2c76b9816 | 20 | {1,0,1,0,0,0,1,0,1,1,0,1,0,1,0,0,1,1,0,1}, |
Rhyme | 0:f2f2c76b9816 | 21 | {1,0,1,0,1,1,1,0,0,1,0,1,0,1,0,1,1,1,0,1}, |
Rhyme | 0:f2f2c76b9816 | 22 | {1,0,1,0,1,1,1,1,1,1,0,1,0,1,0,0,0,1,0,1}, |
Rhyme | 0:f2f2c76b9816 | 23 | {1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1}, |
Rhyme | 0:f2f2c76b9816 | 24 | {1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1}, |
Rhyme | 0:f2f2c76b9816 | 25 | {1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1}, |
Rhyme | 0:f2f2c76b9816 | 26 | {1,0,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1}, |
Rhyme | 0:f2f2c76b9816 | 27 | {1,0,1,0,1,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1}, |
Rhyme | 0:f2f2c76b9816 | 28 | {1,0,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1}, |
Rhyme | 0:f2f2c76b9816 | 29 | {1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1}, |
Rhyme | 0:f2f2c76b9816 | 30 | {1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1}, |
Rhyme | 0:f2f2c76b9816 | 31 | {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1}, |
Rhyme | 0:f2f2c76b9816 | 32 | {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1} |
Rhyme | 0:f2f2c76b9816 | 33 | } ; |
Rhyme | 0:f2f2c76b9816 | 34 | #endif // _MAZE_H_ |