When you say it's for an exam, is that an exam that tests YOUR ability to write code?

It sounds like you're using specialised hardware, so only someone with that hardware will be able to provide code that works. Have you tried asking your tutor for the code?