Kyle Lemons / Mbed 2 deprecated HvZ

Dependencies:   XBeeLib mbed HvZAlphaNumLib HvZServerLib

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "lib/iHvZ.hpp"
00003 #include "XBee.hpp"
00004 #include "string.h"
00005 
00006 iHvZ        game("TEST_UID");
00007 Serial      usb(USBTX, USBRX);
00008 DigitalOut  human_led(LED1);
00009 
00010 void dots() {
00011     usb.printf(".");
00012 }
00013 
00014 Ticker      dotter;
00015 
00016 int main() {
00017     dotter.attach(dots, 10);
00018     
00019     usb.printf("Starting iHvZ:\r\n");
00020     
00021     if (game.load())
00022     {
00023         usb.printf(" - Loading state from file\r\n");
00024     }
00025     else
00026     {
00027         usb.printf(" - Starting as ZOMBIE (no file read)\r\n");
00028         //game.life("FAKE_TID");
00029     }
00030     game.save();
00031     
00032     while(1)
00033     {        
00034         //(game.alphanumdisplay_device()).display('H');
00035         human_led = game.status() == STATUS_HUMAN;
00036         wait(.1);
00037     }
00038 }