icstation 4x4x4 led cube kit

Have a look at this library and example code. Make sure you read documentation in the docs folder.