This is THE 447 FINAL PROJECT this is the frame work put your code in the spot where the it suppose to go and. Make sure you import this into your complier and work on your section, once you done just commit the changes and fork to a new folder

Dependencies:   mbed-rtos mbed draw_test EALib SWSPI

Revision:
2:b14759e704c7
Parent:
1:3f7aa28da00d
Child:
3:84d9362dffeb
--- a/main.cpp	Tue Dec 01 01:08:16 2015 +0000
+++ b/main.cpp	Tue Dec 01 01:44:48 2015 +0000
@@ -1,5 +1,7 @@
+#include <iostream>
 #include "mbed.h"
 #include "cmsis_os.h"
+using namespace std;
 
 //declare your input pin and output pin here:
 //DigitalOut led1(p25);
@@ -7,8 +9,12 @@
 //DigitalOut led3(p28);
 //
 // declare you globle variable here:
-unsigned char X_coor = 0,Y_coor = 0x0A;
-unsigned char LEDs = ((X_coor << 8)|Y_coor);
+unsigned char my_X_coor = 0, my_Y_coor = 0;
+unsigned char my_LEDs = ((X_coor << 8)|Y_coor);
+unsigned char other_X_coor = 0, other_Y_coor = 0;
+int friendly [6][6]; // array to determine friendly location
+ 
+
 //X_coor is x coordinate from 0 to 6
 //Y_coor is y coordinate form A to F
 //
@@ -17,23 +23,30 @@
 
 // this thread is your SPI communication between 2 board
 void SPI_communication(void const *args) {
+    //send my_X_coor and my_Y_coor if the center button is hit
+    //receive other board x_coor and y_coor
     //spi code here
 }
 
 // joystick update x_coor and y_coor here
 void joy_stick_read(void const *args) { //might be an interrupt thread here for interrupt read of joystick
     // joy stick to update global val of x_coor and y_coor;
+    // convert y coor to hex offset
     // update the 8 LEDs here
 }
 
 // this thread use to update the game board
-void game_view_update () {
+void game_view_update (void const *args) {
+    // board of this game will be a class this update and get info to and from the class
     // update the by led game update
     // Uart runing at 921600 max speed; hopefully print 1 line and out;
     // x = hit
     // o = miss
     // > = your ship ship
-
+    
+    // 1) check for a hit
+    // 2) update the game board
+    
     // BLANK game Board
     // F _ _ _ _ _ _   F _ _ _ _ _ _ 
     // E _ _ _ _ _ _   E _ _ _ _ _ _ 
@@ -49,35 +62,35 @@
     // E > _ O _ > _   E _ _ X _ _ _ 
     // D _ _ > _ _ _   D _ _ _ O _ _ 
     // C O _ _ _ _ _   C _ O _ _ _ _ 
-    // B _ X _ O _ _   B _ _ _ X _ _ 
+    // B _ X _ O _ _   B _ _ _ X _ _   //X on friendly mean your ship got destroy 
     // A _ _ _ > _ _   A _ _ _ _ _ _ 
     //   1 2 3 4 5 6     1 2 3 4 5 6
     // Friendly        Enemy
     // Turn 1 = miss at 2F
-    // Turn 2 = Destroy Enemy battle ship at 3E
+    // Turn 2 = We sink an enemy battle ship at 3E
     // Turn 3 = miss at 4D
     // Turn 4 = miss at 2C
-    // Tunr 5 = Destroy Enemy battle ship at 4B 
+    // Tunr 5 = We sink an enemy battle ship at 4B 
            
 }
 
 // code here to check for winer and turn on the RGB
-void winnercheck () {
+void winnercheck (void const *args) {
     //check for winner by some condition
 }
 
 //read the accele
-void checkreset () {
+void checkreset (void const *args) {
     //read the acceleron meter and compare against the previous value to
     //determine if the board have been shake the reset the game board;
 }
 
 
-osThreadDef(SPI_communication, osPriorityNormal, DEFAULT_STACK_SIZE); //comm between 2 board
-osThreadDef(joy_stick_read, osPriorityNormal, DEFAULT_STACK_SIZE);//might be an interrupt;
-osThreadDef(game_view_update, osPriorityNormal, DEFAULT_STACK_SIZE);//update game view write to the fifo uart buffer
-osThreadDef(winnercheck, osPriorityNormal, DEFAULT_STACK_SIZE); //check for winner
-osThreadDef(checkreset, osPriorityNormal, DEFAULT_STACK_SIZE); //check for reset
+osThreadDef(SPI_communication, osPriorityNormal, DEFAULT_STACK_SIZE); //comm between 2 board define thread
+osThreadDef(joy_stick_read, osPriorityNormal, DEFAULT_STACK_SIZE);//might be an interrupt define thread
+osThreadDef(game_view_update, osPriorityNormal, DEFAULT_STACK_SIZE);//update game view write to the fifo uart buffer define thread
+osThreadDef(winnercheck, osPriorityNormal, DEFAULT_STACK_SIZE); //check for winner define thread
+osThreadDef(checkreset, osPriorityNormal, DEFAULT_STACK_SIZE); //check for reset define thread
 
 int main() {
     osThreadCreate(osThread(SPI_communication), NULL);
@@ -90,6 +103,8 @@
     //
     //
     
+    //note game initialize and setup upon shake the board
+    
     //Main Thread
     while (true) {
         //check status and update status