iv
ARDUINO ─ ADVANCED ........................................................................................................... 102
Arduino – Due & Zero ........................................................................................................................... 103
Arduino Zero ................................................................................................................................................ 104
Arduino – Pulse Width Modulation ....................................................................................................... 106
Basic Principle of PWM ................................................................................................................................ 106
analogWrite() Function................................................................................................................................ 107
Arduino – Random Numbers ................................................................................................................. 109
randomSeed (seed) ..................................................................................................................................... 109
random( ) ..................................................................................................................................................... 109
Bits ............................................................................................................................................................... 110
Bytes ............................................................................................................................................................ 110
Arduino – Interrupts ............................................................................................................................. 112
Types of Interrupts ...................................................................................................................................... 113
Arduino – Communication .................................................................................................................... 115
Parallel Communication .............................................................................................................................. 115
Serial Communication Modules .................................................................................................................. 115
Types of Serial Communications ................................................................................................................. 116
Arduino UART .............................................................................................................................................. 117
Arduino – Inter Integrated Circuit ......................................................................................................... 119
Board I2C Pins .............................................................................................................................................. 119
Arduino I2C .................................................................................................................................................. 119
Master Transmitter / Slave Receiver ........................................................................................................... 120
Master Receiver / Slave Transmitter ........................................................................................................... 121
Arduino – Serial Peripheral Interface .................................................................................................... 123
Board SPI Pins .............................................................................................................................................. 123
SPI as MASTER ............................................................................................................................................. 124
SPI as SLAVE ................................................................................................................................................. 125
ARDUINO – PROJECTS ............................................................................................................. 127
Arduino – Blinking LED .......................................................................................................................... 128
Arduino – Fading LED ........................................................................................................................... 132
Arduino – Reading Analog Voltage ........................................................................................................ 137
Arduino – LED Bar Graph....................................................................................................................... 141
Arduino – Keyboard Logout .................................................................................................................. 145
Arduino – Keyboard Message ............................................................................................................... 151
Arduino – Mouse Button Control .......................................................................................................... 154
Arduino – Keyboard Serial .................................................................................................................... 158