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”というバナーが出てゲーム終了です。
Diff: maze.h
- Revision:
- 0:f2f2c76b9816
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/maze.h Sun Dec 07 10:17:42 2014 +0000 @@ -0,0 +1,34 @@ +#ifndef _MAZE_H_ +#define _MAZE_H_ defined + +#define MAZE_W 20 +#define MAZE_H 20 + +#define POS_PATH 0 +#define POS_WALL 1 +#define POS_START 2 +#define POS_GOAL 3 + +uint8_t maze[MAZE_H][MAZE_W] = { + {1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, + {1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, + {1,0,1,0,1,0,1,1,1,1,0,1,1,1,1,1,1,1,0,1}, + {1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,1,0,1}, + {1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,1,0,1}, + {1,0,0,0,1,0,1,0,1,0,0,0,0,0,1,0,1,1,0,1}, + {1,0,1,1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1}, + {1,0,1,0,0,0,1,0,1,1,0,1,0,1,0,0,1,1,0,1}, + {1,0,1,0,1,1,1,0,0,1,0,1,0,1,0,1,1,1,0,1}, + {1,0,1,0,1,1,1,1,1,1,0,1,0,1,0,0,0,1,0,1}, + {1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1}, + {1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1}, + {1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1}, + {1,0,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1}, + {1,0,1,0,1,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1}, + {1,0,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1}, + {1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1}, + {1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1}, + {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1}, + {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1} +} ; +#endif // _MAZE_H_ \ No newline at end of file