Create main.c

Initial commit of main.c
Initial code copied from Arduino code base