Arduino code:

The following modes are supported for the basic input and output: