start from the blinc example.. study it and read the reference
this is so simple that i think you shouldnt ask for a code example but do a little bit homework.
the more rewarding it will be when you have solved it.
hint try using an if statement... and a variable..