SlideShare a Scribd company logo
1 of 13
How to Build a Better Arduino – the Development of MHVlib Alastair D’Silva @EvilDeece http://alastair.d-silva.org http://www.makehackvoid.com
What is an Arduino A hardware and software platform for prototyping electronics Low entry barrier allows programmers to interact with the real world Built on top of Wiring
Love Arduino Cheap hardware Simple to understand Serial bootloader makes programming easy
Hate Arduino Slow Memory inefficient Caused by: Excessing handholding Backwards compatibility
Fix Arduino Keep the good parts Hardware Bootloader Ditch the bad parts Runtime libraries
Design Philosophy Portable (support all ATMEGA & ATTINY) Lean Memory efficient Use interrupts if possible No deprecated calls No warnings
HardwareSerial Arduino Uses fixed length, preallocated 128 byte RX buffers Preinstanties 1 object for each serial port Reinvents the wheel regarding string formatting Interrupt driven RX, busy TX MHVlib User allocates buffers and passes them in User instantiates only what is needed Provides interrupt driven & busy variants of RX/TX Provides PROGMEM TX support
Digital IO Arduino Lots of handholding Uses extensive tables in PROGMEM to look up pin ports & bits ~55 clocks MHVlib No handholding Uses macros Single instruction, 2 clocks
MHVlib Digital IO io.h:           //Dir,Output,Input,Bit #define MHV_PIN_B0 &DDRB,&PORTB, &PINB,0 #define mhv_pinOn(mhvParms) br />do { br />	_mhv_pinOn(mhvParms) br />} while(0) #define _mhv_pinOn(mhvDir,mhvOutput,mhvInput,mhvBit) br />*mhvOutput |= _BV(mhvBit);
Digital IO Usage Arduino pinMode(13, OUTPUT); digitalWrite(13, 1); MHVlib mhv_setOutput(MHV_ARDUINO_PIN_13); mhv_pinOn(MHV_ARDUINO_PIN_13);
Servo Library Arduino Servo Consumes 1 16 bit timer per 12 servos ~10 bits of significance Resolution of 16 clock cycles ArduinoSoftwareServo Uses a 16 bit int, valid values are 0 to 180 Refresh must be called periodically Sorts the list of servo positions on each pass Lots of busy waiting MHVlib Uses a uint16_t, 0-65535 (~14 bits significant) Consumes 1 16 bit timer Resolution of 2 clock cycles No restrictions as to how many servos Only sorts when positions change
References http://billgrundmann.wordpress.com/2009/03/03/to-use-or-not-use-writedigital/ http://www.arduino.cc
First (Real) Project Spindle controller for a CNC Mill Generates a servo signal to a BLDC controller to drive an RC helicopter motor (up to 1.8kW) Read from the serial port and set the speed Monitor the spindle and adjust the speed Report actual speed back to the PC Arduino version 11,900 bytes of flash 500 bytes of RAM MHVlib version 6930 bytes of flash 177 bytes of RAM

More Related Content

What's hot

Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينوsalih mahmod
 
how to generate sms
how to generate smshow to generate sms
how to generate smssumant reddy
 
Hardware Hacking
Hardware HackingHardware Hacking
Hardware Hackingrngtng
 
Robotics and Arduino (Arduino UNO)
Robotics and Arduino (Arduino UNO)Robotics and Arduino (Arduino UNO)
Robotics and Arduino (Arduino UNO)Dragos Ionita
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino unoRahat Sood
 
Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Sudar Muthu
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the ArduinoWingston
 
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009Eoin Brazil
 
Arduino Robotics workshop day2
Arduino Robotics workshop day2Arduino Robotics workshop day2
Arduino Robotics workshop day2Sudar Muthu
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATIONsoma saikiran
 
Controlling the internet of things using wearable tech - Design+Code Day; Ara...
Controlling the internet of things using wearable tech - Design+Code Day; Ara...Controlling the internet of things using wearable tech - Design+Code Day; Ara...
Controlling the internet of things using wearable tech - Design+Code Day; Ara...ArabNet ME
 
Wemakeit - base workshop - openlabs
Wemakeit - base workshop - openlabsWemakeit - base workshop - openlabs
Wemakeit - base workshop - openlabsLuca Pescatore
 
concurrency.cc OSHUG #3
concurrency.cc OSHUG #3concurrency.cc OSHUG #3
concurrency.cc OSHUG #3Omer Kilic
 
Integrare Arduino con Unity
Integrare Arduino con UnityIntegrare Arduino con Unity
Integrare Arduino con UnityCodemotion
 

What's hot (20)

Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 
how to generate sms
how to generate smshow to generate sms
how to generate sms
 
Hardware Hacking
Hardware HackingHardware Hacking
Hardware Hacking
 
Robotics and Arduino (Arduino UNO)
Robotics and Arduino (Arduino UNO)Robotics and Arduino (Arduino UNO)
Robotics and Arduino (Arduino UNO)
 
Arduino IDE
Arduino IDEArduino IDE
Arduino IDE
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 
Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Arduino Robotics workshop Day1
Arduino Robotics workshop Day1
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
 
Arduino Robotics workshop day2
Arduino Robotics workshop day2Arduino Robotics workshop day2
Arduino Robotics workshop day2
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATION
 
Controlling the internet of things using wearable tech - Design+Code Day; Ara...
Controlling the internet of things using wearable tech - Design+Code Day; Ara...Controlling the internet of things using wearable tech - Design+Code Day; Ara...
Controlling the internet of things using wearable tech - Design+Code Day; Ara...
 
Robotics with arduino
Robotics  with arduinoRobotics  with arduino
Robotics with arduino
 
Arduino uno
Arduino unoArduino uno
Arduino uno
 
Wemakeit - base workshop - openlabs
Wemakeit - base workshop - openlabsWemakeit - base workshop - openlabs
Wemakeit - base workshop - openlabs
 
concurrency.cc OSHUG #3
concurrency.cc OSHUG #3concurrency.cc OSHUG #3
concurrency.cc OSHUG #3
 
Integrare Arduino con Unity
Integrare Arduino con UnityIntegrare Arduino con Unity
Integrare Arduino con Unity
 
Introduction Arduino
Introduction Arduino Introduction Arduino
Introduction Arduino
 
What is Arduino ?
What is Arduino ?What is Arduino ?
What is Arduino ?
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 

Viewers also liked

A Brief Tour of Responsability Driven Design
A Brief Tour of Responsability Driven DesignA Brief Tour of Responsability Driven Design
A Brief Tour of Responsability Driven Designelliando dias
 
Scaling Rails with memcached
Scaling Rails with memcachedScaling Rails with memcached
Scaling Rails with memcachedelliando dias
 
Model-Driven Software Development
Model-Driven Software DevelopmentModel-Driven Software Development
Model-Driven Software Developmentelliando dias
 
Assembling wall panels with robotic technologies
Assembling wall panels with robotic technologiesAssembling wall panels with robotic technologies
Assembling wall panels with robotic technologieselliando dias
 
Scrum in five minutes
Scrum in five minutesScrum in five minutes
Scrum in five minuteselliando dias
 
Programmable Matter with Modular Robots
Programmable Matter with Modular RobotsProgrammable Matter with Modular Robots
Programmable Matter with Modular Robotselliando dias
 
Gerenciamento de Projetos OO
Gerenciamento de Projetos OOGerenciamento de Projetos OO
Gerenciamento de Projetos OOelliando dias
 
How to Design Frameworks
How to Design FrameworksHow to Design Frameworks
How to Design Frameworkselliando dias
 
HTML5: The New html for the web
HTML5: The New html for the webHTML5: The New html for the web
HTML5: The New html for the webelliando dias
 
Interfaces de Usuário Ubíquas - UUI
Interfaces de Usuário Ubíquas - UUIInterfaces de Usuário Ubíquas - UUI
Interfaces de Usuário Ubíquas - UUIelliando dias
 
hardware de um sistema de computação
hardware de um sistema de computaçãohardware de um sistema de computação
hardware de um sistema de computaçãoelliando dias
 
Enabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition LanguageEnabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition Languageelliando dias
 
Representação de Números
Representação de NúmerosRepresentação de Números
Representação de Númeroselliando dias
 
Linguagens de Transformação de Modelos
Linguagens de Transformação de ModelosLinguagens de Transformação de Modelos
Linguagens de Transformação de Modeloselliando dias
 
UML-Based Web Engineering
UML-Based Web EngineeringUML-Based Web Engineering
UML-Based Web Engineeringelliando dias
 
Gerenciamento de Projeto para Desenvolvimento de Sistema
Gerenciamento de Projeto para Desenvolvimento de SistemaGerenciamento de Projeto para Desenvolvimento de Sistema
Gerenciamento de Projeto para Desenvolvimento de Sistemaelliando dias
 
Banco De Dados Básico
Banco De Dados BásicoBanco De Dados Básico
Banco De Dados Básicoelliando dias
 

Viewers also liked (20)

A Brief Tour of Responsability Driven Design
A Brief Tour of Responsability Driven DesignA Brief Tour of Responsability Driven Design
A Brief Tour of Responsability Driven Design
 
Algoritmo Genetico
Algoritmo GeneticoAlgoritmo Genetico
Algoritmo Genetico
 
Scaling Rails with memcached
Scaling Rails with memcachedScaling Rails with memcached
Scaling Rails with memcached
 
Model-Driven Software Development
Model-Driven Software DevelopmentModel-Driven Software Development
Model-Driven Software Development
 
Assembling wall panels with robotic technologies
Assembling wall panels with robotic technologiesAssembling wall panels with robotic technologies
Assembling wall panels with robotic technologies
 
Acme Total
Acme TotalAcme Total
Acme Total
 
Scrum in five minutes
Scrum in five minutesScrum in five minutes
Scrum in five minutes
 
Programmable Matter with Modular Robots
Programmable Matter with Modular RobotsProgrammable Matter with Modular Robots
Programmable Matter with Modular Robots
 
Gerenciamento de Projetos OO
Gerenciamento de Projetos OOGerenciamento de Projetos OO
Gerenciamento de Projetos OO
 
How to Design Frameworks
How to Design FrameworksHow to Design Frameworks
How to Design Frameworks
 
HTML5: The New html for the web
HTML5: The New html for the webHTML5: The New html for the web
HTML5: The New html for the web
 
Interfaces de Usuário Ubíquas - UUI
Interfaces de Usuário Ubíquas - UUIInterfaces de Usuário Ubíquas - UUI
Interfaces de Usuário Ubíquas - UUI
 
hardware de um sistema de computação
hardware de um sistema de computaçãohardware de um sistema de computação
hardware de um sistema de computação
 
Enabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition LanguageEnabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition Language
 
Representação de Números
Representação de NúmerosRepresentação de Números
Representação de Números
 
Linguagens de Transformação de Modelos
Linguagens de Transformação de ModelosLinguagens de Transformação de Modelos
Linguagens de Transformação de Modelos
 
Robótica Móvel
Robótica MóvelRobótica Móvel
Robótica Móvel
 
UML-Based Web Engineering
UML-Based Web EngineeringUML-Based Web Engineering
UML-Based Web Engineering
 
Gerenciamento de Projeto para Desenvolvimento de Sistema
Gerenciamento de Projeto para Desenvolvimento de SistemaGerenciamento de Projeto para Desenvolvimento de Sistema
Gerenciamento de Projeto para Desenvolvimento de Sistema
 
Banco De Dados Básico
Banco De Dados BásicoBanco De Dados Básico
Banco De Dados Básico
 

Similar to How To Build A Better Arduino

Similar to How To Build A Better Arduino (20)

Arduino Programming Basic
Arduino Programming BasicArduino Programming Basic
Arduino Programming Basic
 
What is arduino
What is arduinoWhat is arduino
What is arduino
 
Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.
 
Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
 
AVR arduino dasar
AVR arduino dasarAVR arduino dasar
AVR arduino dasar
 
arduino.pdf
arduino.pdfarduino.pdf
arduino.pdf
 
Lecture6
Lecture6Lecture6
Lecture6
 
How to use an Arduino
How to use an ArduinoHow to use an Arduino
How to use an Arduino
 
Multi Sensory Communication 2/2
Multi Sensory Communication 2/2Multi Sensory Communication 2/2
Multi Sensory Communication 2/2
 
Introduction to Arduino 16822775 (2).ppt
Introduction to Arduino 16822775 (2).pptIntroduction to Arduino 16822775 (2).ppt
Introduction to Arduino 16822775 (2).ppt
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino Course
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptx
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
Embedded system - introduction to arm7
Embedded system -  introduction to arm7Embedded system -  introduction to arm7
Embedded system - introduction to arm7
 
Presentation
PresentationPresentation
Presentation
 
Arduino intro.pptx
Arduino intro.pptxArduino intro.pptx
Arduino intro.pptx
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 Presentation
 
Avr report
Avr reportAvr report
Avr report
 
Arduino
ArduinoArduino
Arduino
 
Rig nitc [autosaved] (copy)
Rig nitc [autosaved] (copy)Rig nitc [autosaved] (copy)
Rig nitc [autosaved] (copy)
 

Recently uploaded

Inspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxInspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxShubham Rawat
 
E J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxE J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxJackieSparrow3
 
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ EscortsDelhi Escorts Service
 
西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做j5bzwet6
 
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 AvilableCall Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilabledollysharma2066
 
南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证kbdhl05e
 
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan
 
(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)oannq
 

Recently uploaded (9)

Inspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxInspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptx
 
E J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxE J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptx
 
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
 
西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做
 
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 AvilableCall Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
 
南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证
 
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
 
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
 
(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)
 

How To Build A Better Arduino

  • 1. How to Build a Better Arduino – the Development of MHVlib Alastair D’Silva @EvilDeece http://alastair.d-silva.org http://www.makehackvoid.com
  • 2. What is an Arduino A hardware and software platform for prototyping electronics Low entry barrier allows programmers to interact with the real world Built on top of Wiring
  • 3. Love Arduino Cheap hardware Simple to understand Serial bootloader makes programming easy
  • 4. Hate Arduino Slow Memory inefficient Caused by: Excessing handholding Backwards compatibility
  • 5. Fix Arduino Keep the good parts Hardware Bootloader Ditch the bad parts Runtime libraries
  • 6. Design Philosophy Portable (support all ATMEGA & ATTINY) Lean Memory efficient Use interrupts if possible No deprecated calls No warnings
  • 7. HardwareSerial Arduino Uses fixed length, preallocated 128 byte RX buffers Preinstanties 1 object for each serial port Reinvents the wheel regarding string formatting Interrupt driven RX, busy TX MHVlib User allocates buffers and passes them in User instantiates only what is needed Provides interrupt driven & busy variants of RX/TX Provides PROGMEM TX support
  • 8. Digital IO Arduino Lots of handholding Uses extensive tables in PROGMEM to look up pin ports & bits ~55 clocks MHVlib No handholding Uses macros Single instruction, 2 clocks
  • 9. MHVlib Digital IO io.h: //Dir,Output,Input,Bit #define MHV_PIN_B0 &DDRB,&PORTB, &PINB,0 #define mhv_pinOn(mhvParms) br />do { br /> _mhv_pinOn(mhvParms) br />} while(0) #define _mhv_pinOn(mhvDir,mhvOutput,mhvInput,mhvBit) br />*mhvOutput |= _BV(mhvBit);
  • 10. Digital IO Usage Arduino pinMode(13, OUTPUT); digitalWrite(13, 1); MHVlib mhv_setOutput(MHV_ARDUINO_PIN_13); mhv_pinOn(MHV_ARDUINO_PIN_13);
  • 11. Servo Library Arduino Servo Consumes 1 16 bit timer per 12 servos ~10 bits of significance Resolution of 16 clock cycles ArduinoSoftwareServo Uses a 16 bit int, valid values are 0 to 180 Refresh must be called periodically Sorts the list of servo positions on each pass Lots of busy waiting MHVlib Uses a uint16_t, 0-65535 (~14 bits significant) Consumes 1 16 bit timer Resolution of 2 clock cycles No restrictions as to how many servos Only sorts when positions change
  • 13. First (Real) Project Spindle controller for a CNC Mill Generates a servo signal to a BLDC controller to drive an RC helicopter motor (up to 1.8kW) Read from the serial port and set the speed Monitor the spindle and adjust the speed Report actual speed back to the PC Arduino version 11,900 bytes of flash 500 bytes of RAM MHVlib version 6930 bytes of flash 177 bytes of RAM

Editor's Notes

  1. Wiring is a simplified form of C++ - it provides a simple API and removes some of the requirements of C++ by using a preprocessor to do things such as automatic prototype declarations.
  2. Currently have support for ATMEGA168, 328, 1280 & ATTINY2313. Adding new microcontrollers involves creating a new header file from the data sheet. Most of it can be cut and pasted from an existing header as Atmel have strived to be consistent between controllers.We try to keep the code lean by doing as little handholding as possible – we just get the job done, in as few instructions as possibleAvoid unnecessary memory allocations, use appropriate datatypesWe provide busy waiting and interrupt driven variants of most peripheral functions, allowing the microcontroller to get on with other work while the task progressesThe Arduino libraries make use of deprecated macros such as the old cbi & sbi macros, and also produces warnings when compiled