Here's some things you may have to consider when adapting Arduino sketches:
Here's some handy specifications: