post your existing project ... even if all it does is show us how the I/O is configured, that would help us help you ...
without some details to go on, about all that we can do is quote what's already stated in the book ... (you've already studied that - right?) ...
and by the way - is this a "real world" project - or a student exercise for a class you're taking? ... we'll help either way - but we can give better help if we know where you're heading with this ...
and what are you trying to heat? ...