ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el19tb

Dependencies:   mbed

Committer:
el19tb
Date:
Wed May 27 01:54:46 2020 +0000
Revision:
61:3714af9caab6
Parent:
53:b6bb4dab7823
Final Submission. I have read and agreed with Statement of Academic Integrity.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el19tb 13:cd6d2f999057 1 #ifndef VEHICLE_H
el19tb 13:cd6d2f999057 2 #define VEHICLE_H
el19tb 13:cd6d2f999057 3
el19tb 38:a6e040bf0e35 4
el19tb 47:29c4796a49e5 5 const int frog_state_up[4][6] = {
el19tb 47:29c4796a49e5 6 //final and initial state of frog
el19tb 47:29c4796a49e5 7 { 1, 0, 1, 1, 0, 1 },
el19tb 47:29c4796a49e5 8 { 0, 1, 1, 1, 1, 0 },
el19tb 47:29c4796a49e5 9 { 0, 1, 1, 1, 1, 0 },
el19tb 47:29c4796a49e5 10 { 1, 0, 0, 0, 0, 1 },
el19tb 47:29c4796a49e5 11
el19tb 13:cd6d2f999057 12 };
el19tb 13:cd6d2f999057 13
el19tb 47:29c4796a49e5 14 const int frog_state_left[4][6] = {
el19tb 47:29c4796a49e5 15
el19tb 47:29c4796a49e5 16 // middle state of frog
el19tb 47:29c4796a49e5 17 { 1, 1, 0, 0, 1, 0 },
el19tb 47:29c4796a49e5 18 { 0, 1, 1, 1, 1, 1 },
el19tb 47:29c4796a49e5 19 { 0, 1, 1, 1, 1, 1 },
el19tb 47:29c4796a49e5 20 { 1, 1, 0, 0, 1, 0 },
el19tb 13:cd6d2f999057 21 };
el19tb 13:cd6d2f999057 22
el19tb 47:29c4796a49e5 23 const int frog_state_right[4][6] = {
el19tb 47:29c4796a49e5 24
el19tb 47:29c4796a49e5 25 // middle state of frog
el19tb 47:29c4796a49e5 26 { 0, 1, 0, 0, 1, 1 },
el19tb 47:29c4796a49e5 27 { 1, 1, 1, 1, 1, 0 },
el19tb 47:29c4796a49e5 28 { 1, 1, 1, 1, 1, 0 },
el19tb 47:29c4796a49e5 29 { 0, 1, 0, 0, 1, 1 },
el19tb 47:29c4796a49e5 30 };
el19tb 38:a6e040bf0e35 31
el19tb 47:29c4796a49e5 32 const int frog_state_down[4][6] = {
el19tb 47:29c4796a49e5 33
el19tb 47:29c4796a49e5 34 // middle state of frog
el19tb 38:a6e040bf0e35 35 { 1, 0, 0, 0, 0, 1 },
el19tb 38:a6e040bf0e35 36 { 0, 1, 1, 1, 1, 0 },
el19tb 38:a6e040bf0e35 37 { 0, 1, 1, 1, 1, 0 },
el19tb 47:29c4796a49e5 38 { 1, 0, 1, 1, 0, 1 },
el19tb 47:29c4796a49e5 39 };
el19tb 38:a6e040bf0e35 40
el19tb 44:f02510eeb165 41
el19tb 44:f02510eeb165 42 // B
el19tb 46:e39abe665271 43 const int bus[4][16] = {
el19tb 44:f02510eeb165 44
el19tb 44:f02510eeb165 45 // bus has a longer width
el19tb 46:e39abe665271 46 { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
el19tb 46:e39abe665271 47 { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1 },
el19tb 46:e39abe665271 48 { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
el19tb 46:e39abe665271 49 { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0 },
el19tb 44:f02510eeb165 50
el19tb 44:f02510eeb165 51 };
el19tb 38:a6e040bf0e35 52
el19tb 38:a6e040bf0e35 53 // R
el19tb 46:e39abe665271 54 const int right_racer[4][12] = {
el19tb 38:a6e040bf0e35 55
el19tb 46:e39abe665271 56 { 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
el19tb 46:e39abe665271 57 { 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1 },
el19tb 46:e39abe665271 58 { 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1 },
el19tb 46:e39abe665271 59 { 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0 },
el19tb 38:a6e040bf0e35 60
el19tb 38:a6e040bf0e35 61 };
el19tb 38:a6e040bf0e35 62
el19tb 38:a6e040bf0e35 63 // L
el19tb 46:e39abe665271 64 const int left_racer[4][12] = {
el19tb 45:e40c4f89ed7c 65
el19tb 46:e39abe665271 66 { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1 },
el19tb 46:e39abe665271 67 { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1 },
el19tb 46:e39abe665271 68 { 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1 },
el19tb 46:e39abe665271 69 { 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0 },
el19tb 38:a6e040bf0e35 70
el19tb 38:a6e040bf0e35 71 };
el19tb 38:a6e040bf0e35 72
el19tb 38:a6e040bf0e35 73 // N
el19tb 46:e39abe665271 74 const int right_normal[4][10] = {
el19tb 45:e40c4f89ed7c 75
el19tb 46:e39abe665271 76 { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
el19tb 46:e39abe665271 77 { 1, 0, 0, 0, 0, 0, 0, 1, 1, 1 },
el19tb 46:e39abe665271 78 { 1, 1, 0, 1, 1, 0, 1, 1, 1, 1 },
el19tb 46:e39abe665271 79 { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0 },
el19tb 38:a6e040bf0e35 80
el19tb 38:a6e040bf0e35 81 };
el19tb 38:a6e040bf0e35 82
el19tb 38:a6e040bf0e35 83 // X
el19tb 46:e39abe665271 84 const int left_normal[4][10] = {
el19tb 38:a6e040bf0e35 85
el19tb 46:e39abe665271 86 { 0, 0, 0, 1, 1, 1, 1, 1, 1, 0 },
el19tb 46:e39abe665271 87 { 1, 1, 1, 0, 0, 0, 0, 0, 0, 1 },
el19tb 46:e39abe665271 88 { 1, 1, 1, 0, 1, 1, 1, 0, 1, 1 },
el19tb 46:e39abe665271 89 { 0, 0, 1, 1, 0, 0, 1, 1, 0, 0 },
el19tb 38:a6e040bf0e35 90
el19tb 38:a6e040bf0e35 91 };
el19tb 38:a6e040bf0e35 92
el19tb 53:b6bb4dab7823 93 const int star[4][12] = {
el19tb 53:b6bb4dab7823 94
el19tb 53:b6bb4dab7823 95 { 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1 },
el19tb 53:b6bb4dab7823 96 { 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1 },
el19tb 53:b6bb4dab7823 97 { 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1 },
el19tb 53:b6bb4dab7823 98 { 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0 },
el19tb 53:b6bb4dab7823 99
el19tb 53:b6bb4dab7823 100 };
el19tb 53:b6bb4dab7823 101
el19tb 13:cd6d2f999057 102 #endif