YRL Maze lab made more script-y

Dependencies:   PsiSwarmLab-ScriptingBased mbed

Fork of UKESF_Lab by UKESF Headstart Summer School

main.cpp

Committer:
jah128
Date:
2016-03-15
Revision:
30:513457c1ad12
Parent:
28:46d650381972
Child:
31:7fa2c47d73a2

File content as of revision 30:513457c1ad12:

/***********************************************************************
**  ██████╗ ███████╗██╗███████╗██╗    ██╗ █████╗ ██████╗ ███╗   ███╗  **
**  ██╔══██╗██╔════╝██║██╔════╝██║    ██║██╔══██╗██╔══██╗████╗ ████║  **
**  ██████╔╝███████╗██║███████╗██║ █╗ ██║███████║██████╔╝██╔████╔██║  **
**  ██╔═══╝ ╚════██║██║╚════██║██║███╗██║██╔══██║██╔══██╗██║╚██╔╝██║  **
**  ██║     ███████║██║███████║╚███╔███╔╝██║  ██║██║  ██║██║ ╚═╝ ██║  **
**  ╚═╝     ╚══════╝╚═╝╚══════╝ ╚══╝╚══╝ ╚═╝  ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝  **
************************************************************************
**(C) Dr James Hilder - York Robotics Laboratory - University of York **
***********************************************************************/

/// PsiSwarm Blank Example Code
/// Version 0.41
/// James Hilder, Alan Millard, Alexander Horsfield, Homero Elizondo, Jon Timmis
/// University of York

/// Include main.h - this includes psiswarm.h all the other necessary core files
#include "main.h"

char * program_name = "Blank";
char * author_name  = "YRL";
char * version_name = "0.41";

void user_code_loop()
{
    wait(1);   
}

///Place user code here that should be run after initialisation but before the main loop
void user_code_setup()
{
    wait(1);
    display.clear_display();
    display.set_position(0,0);
    display.write_string("No Code");  
    
    //bmeme_user_code_setup(); 
}

/// Code goes here to handle what should happen when the user switch is pressed
void handle_switch_event(char switch_state)
{
    /// Switch_state = 1 if up is pressed, 2 if down is pressed, 4 if left is pressed, 8 if right is pressed and 16 if the center button is pressed
    /// NB For maximum compatability it is recommended to minimise reliance on center button press

    //bmeme_handle_switch_event(switch_state);
}

void handle_user_serial_message(char * message, char length, char interface)
{
    // This is where user code for handling a (non-system) serial message should go
    //
    // message = pointer to message char array
    // length = length of message
    // interface = 0 for PC serial connection, 1 for Bluetooth
    
    //bmeme_handle_user_serial_message(message, length, interface);
}

/// The main routine: it is recommended to leave this function alone and add user code to the above functions
int main()
{
    ///init() in psiswarm.cpp sets up the robot
    init();
    user_code_setup();
    user_code_running = 1;
    while(1) {
        user_code_loop();
    }
}