ARDUINO PROGRAMMING
For the friends of the FPGA
,Arduino Programming Elektronica-ICT
Inhoudstabel
H1: Introduction ............................................................................................................... 3
1.1 What is Arduino? ........................................................................................................................... 3
1.2 Arduino Hardware ......................................................................................................................... 3
1.3 Internal Arduino ............................................................................................................................ 3
H2: Basics ......................................................................................................................... 4
2.1 Serial Monitor ................................................................................................................................ 4
2.2 Interrupts....................................................................................................................................... 4
2.3 Code Flags...................................................................................................................................... 5
H3: Contact Bounce & Arduino Memory ............................................................................ 5
3.1 Contact Bounce ............................................................................................................................. 5
3.2 Libraries ......................................................................................................................................... 5
3.3 Arduino Memory ........................................................................................................................... 6
3.4 Serial Read - Input Buffer .............................................................................................................. 6
H4: Pointers ..................................................................................................................... 7
4.1 Introduction ................................................................................................................................... 7
4.2 Pointers and Functions .................................................................................................................. 8
4.3 Pointers and Arrays ....................................................................................................................... 8
4.4 Pointer Operations ........................................................................................................................ 8
4.5 Pointer Operations and Arrays ...................................................................................................... 9
H5: AVR-C Toolchain, Preprocessor Commands & Arduinoop ............................................ 9
5.1 AVR Toolchain................................................................................................................................ 9
5.2 Preprocessor Commands ............................................................................................................ 11
5.3 Personal Libraries ........................................................................................................................ 11
5.4 Arduino Object Oriented Programming ...................................................................................... 11
5.5 Application................................................................................................................................... 12
H6: Arduinoop, Data Communication and Driving Loads .................................................. 12
6.1 Differences between C++ and C# ................................................................................................ 12
6.2 Data Communication ................................................................................................................... 12
6.3 Driving High Current Loads .......................................................................................................... 15
APPENDIX: Labo-overzicht .............................................................................................. 17
Labo 1: Introductie en enkele basisschakelingen .............................................................................. 17
Labo 2: Arduino & Electronic Fundamentals ..................................................................................... 18
Labo 3 & 4: Serial monitor, interrupts en “Whack-a-mole” .............................................................. 18
Labo 5: Rotary encoder en 7-segement display ................................................................................ 19
1
, Arduino Programming Elektronica-ICT
Labo 6: EEPROM ................................................................................................................................ 21
Labo 7: Afstandssensor & Servomotor .............................................................................................. 22
Labo 8: Pointers ................................................................................................................................. 23
Labo 10: Processing ........................................................................................................................... 24
Labo 11: Liquid Crystal Display .......................................................................................................... 24
Labo 12: Bluetoothcommunicatie ..................................................................................................... 25
2