Jump to content

Arduino

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 83.23.146.78 (talk) at 00:16, 10 November 2024. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Arduino is a little thing with a microcontroller :)

Arduino
ManufacturerArduino
TypeSingle-board microcontroller
Operating systemNone (default)
Xinu
CPU
MemorySRAM
StorageFlash, EEPROM
Websitearduino.cc


Shields

Arduino and Arduino-compatible boards use printed circuit expansion boards called shields, which plug into the normally supplied Arduino pin headers.[17] Shields can provide motor controls for 3D printing and other applications, GNSS (satellite navigation), Ethernet, liquid crystal display (LCD), or breadboarding (prototyping). Several shields can also be made do it yourself (DIY).[18][19][20]

Software

A program for Arduino hardware may be written in any programming language with compilers that produce binary machine code for the target processor. Atmel provides a development environment for their 8-bit AVR and 32-bit ARM Cortex-M based microcontrollers: AVR Studio (older) and Atmel Studio (newer).[21][22][23]

Legacy IDE

Arduino Legacy IDE
Developer(s)Arduino Software
Stable release
1.8.19 / 21 December 2021; 3 years ago (2021-12-21)[24]
Written inJava, C, C++
Operating systemMicrosoft Windows, macOS, Linux
PlatformIA-32, x86-64, ARM
TypeIntegrated development environment
LicenseLGPL or GPL license
Websitewww.arduino.cc/en/software

The Arduino integrated development environment (IDE) is a cross-platform application (for Microsoft Windows, macOS, and Linux) that is based on Processing IDE which is written in Java. It uses the Wiring API as programming style and HAL. It includes a code editor with features such as text cutting and pasting, searching and replacing text, automatic indenting, brace matching, and syntax highlighting, and provides simple one-click mechanisms to compile and upload programs to an Arduino board. It also contains a message area, a text console, a toolbar with buttons for common functions and a hierarchy of operation menus. The source code for the IDE is released under the GNU General Public License, version 2.[25]

The Arduino IDE supports the languages C and C++ using special rules of code structuring. The Arduino IDE supplies a software library from the Wiring project, which provides many common input and output procedures. User-written code only requires two basic functions, for starting the sketch and the main program loop, that are compiled and linked with a program stub main() into an executable cyclic executive program with the GNU toolchain, also included with the IDE distribution. The Arduino IDE employs the program avrdude to convert the executable code into a text file in hexadecimal encoding that is loaded into the Arduino board by a loader program in the board's firmware. Traditionally, Arduino IDE was used to program Arduino's official boards based on Atmel AVR Microcontrollers, but over time, once the popularity of Arduino grew and the availability of open-source compilers existed, many more platforms from PIC, STM32, TI MSP430, ESP32 can be coded using Arduino IDE.[26]

IDE 2.0

Arduino IDE
Developer(s)Arduino Software
Stable release
2.3.2 / 20 February 2024; 14 months ago (2024-02-20)[27]
Written inTypeScript, JavaScript, Go
Operating systemMicrosoft Windows, macOS, Linux
Platformx86-64
TypeIntegrated development environment
LicenseGNU Affero General Public License v3.0
Websitewww.arduino.cc/en/software

An initial alpha preview of a new Arduino IDE was released on October 18, 2019, as the Arduino Pro IDE. The beta preview was released on March 1, 2021, renamed IDE 2.0. On September 14, 2022, the Arduino IDE 2.0 was officially released as stable.[28]

The system still uses Arduino CLI (Command Line Interface), but improvements include a more professional development environment and autocompletion support.[29] The application frontend is based on the Eclipse Theia Open Source IDE. Its main new features are:[30]

  • Modern, fully featured development environment
  • New Board Manager
  • New Library Manager
  • Project Explorer
  • Basic Auto-Completion and syntax check
  • Serial Monitor with Graph Plotter
  • Dark Mode and DPI awareness
  • 64-bit release
  • Debugging capability

One important feature Arduino IDE 2.0 provides is the debugging feature.[31] It allows users to single-step, insert breakpoints or view memory. Debugging requires a target chip with debug port and a debug probe. The official Arduino Zero board can be debugged out of the box. Other official Arduino SAMD21 boards require a separate SEGGER J-Link or Atmel-ICE.

For a 3rd party board, debugging in Arduino IDE 2.0 is also possible as long as such board supports GDB, OPENOCD and has a debug probe. Community has contributed debugging for ATMega328P based Arduino [32] or CH32 RiscV Boards,[33] etc.

Sketch

A sketch is a program written with the Arduino IDE.[34] Sketches are saved on the development computer as text files with the file extension .ino. Arduino Software (IDE) pre-1.0 saved sketches with the extension .pde.

A minimal Arduino C/C++ program consists of only two functions:[35]

  • setup(): This function is called once when a sketch starts after power-up or reset. It is used to initialize variables, input and output pin modes, and other libraries needed in the sketch. It is analogous to the function main().[36]
  • loop(): After setup() function exits (ends), the loop() function is executed repeatedly in the main program. It controls the board until the board is powered off or is reset. It is analogous to the function while(1).[37]
Blink example
Power LED and Integrated LED on Arduino Compatible Board
Power LED (red) and User LED (green) attached to pin 13 on an Arduino-compatible board

Most Arduino boards contain a light-emitting diode (LED) and a current-limiting resistor connected between pin 13 and ground, which is a convenient feature for many tests and program functions.[38] A typical program used by beginners, akin to Hello, World!, is "blink", which repeatedly blinks the on-board LED integrated into the Arduino board. This program uses the functions pinMode(), digitalWrite(), and delay(), which are provided by the internal libraries included in the IDE environment.[39][40][41] This program is usually loaded into a new Arduino board by the manufacturer.

const int LED_PIN = 13;             // Pin number attached to LED.

void setup() {
    pinMode(LED_PIN, OUTPUT);       // Configure pin 13 to be a digital output.
}

void loop() {
    digitalWrite(LED_PIN, HIGH);    // Turn on the LED.
    delay(1000);                    // Wait 1 second (1000 milliseconds).
    digitalWrite(LED_PIN, LOW);     // Turn off the LED.
    delay(1000);                    // Wait 1 second.
}

Libraries

The open-source nature of the Arduino project has facilitated the publication of many free software libraries that other developers use to augment their projects.

Operating systems/threading

There is a Xinu OS port for the ATmega328P (Arduino Uno and others with the same chip), which includes most of the basic features.[42] The source code of this version is freely available.[43]

There is also a threading tool, named Protothreads. Protothreads are described as "extremely lightweight stackless threads designed for severely memory constrained systems, such as small embedded systems or wireless sensor network nodes.[44]

There is a port of FreeRTOS for the Arduino.[45] This is available from the Arduino Library Manager. It is compatible with a number of boards, including the Uno.

Applications

Simulation

  • Tinkercad, an analog and digital simulator supporting Arduino Simulation, which is commonly used to create 3D models

Recognitions

The Arduino project received an honorary mention in the Digital Communities category at the 2006 Prix Ars Electronica.[50]

The Arduino Engineering Kit won the Bett Award for "Higher Education or Further Education Digital Services" in 2020.[51]

See also

Explanatory notes

References

  1. ^ "Arduino - ArduinoBoardSerial". www.arduino.cc. Retrieved 20 February 2018.
  2. ^ "Arduino - ArduinoBoardDiecimila". www.arduino.cc. Retrieved 20 February 2018.
  3. ^ "Arduino - ArduinoBoardDuemilanove". www.arduino.cc. Retrieved 20 February 2018.
  4. ^ "Arduino Uno Rev3". www.arduino.cc. Retrieved 20 February 2018.
  5. ^ Smith, W.A. "Differences Between the Arduino Uno Revision 2 and Revision 3". startingelectronics.org. Retrieved 20 February 2018.
  6. ^ "Arduino - ArduinoBoardUnoSMD". www.arduino.cc. Retrieved 20 February 2018.
  7. ^ "Arduino Leonardo with Headers". www.arduino.cc. Retrieved 20 February 2018.
  8. ^ "Arduino Pro". www.arduino.cc. Retrieved 20 February 2018.
  9. ^ "Arduino Mega official webpage (arduino.cc)". Retrieved 20 February 2018.
  10. ^ "Arduino Nano". www.arduino.cc. Retrieved 20 February 2018.
  11. ^ "LilyPad Arduino Main Board". www.arduino.cc. Retrieved 20 February 2018.
  12. ^ "Arduino Robot". www.arduino.cc. Retrieved 20 February 2018.
  13. ^ "Arduino Esplora". www.arduino.cc. Retrieved 20 February 2018.
  14. ^ "Arduino Ethernet Rev3 without PoE". www.arduino.cc. Retrieved 20 February 2018.
  15. ^ "Arduino Yún". www.arduino.cc. Retrieved 20 February 2018.
  16. ^ "Arduino Due". www.arduino.cc. Retrieved 20 February 2018.
  17. ^ "Arduino - ArduinoShields". www.arduino.cc. Retrieved 2017-10-04.
  18. ^ "Arduino breadboard shield: $10 & 10 mins". todbot blog. 11 July 2006.
  19. ^ "Arduino Shields for Prototyping". tigoe.net. Archived from the original on 2017-07-02. Retrieved 2011-09-16.
  20. ^ Oxer, Jonathan. "Arduino Shield list". Retrieved 5 Nov 2013.
  21. ^ "Using Atmel Studio for Arduino development". Megunolink.com. Archived from the original on 2013-01-28. Retrieved 2013-01-18.
  22. ^ "Using AVR Studio for Arduino development". Engblaze.com. Archived from the original on 2012-08-28. Retrieved 2013-01-18.
  23. ^ "Ch Arduino". Retrieved 2016-10-07.
  24. ^ "Releases · arduino/Arduino · GitHub". GitHub. Retrieved 12 November 2022.
  25. ^ "arduino/Arduino". August 27, 2020 – via GitHub.
  26. ^ "Unofficial list of 3rd party boards support urls". GitHub. May 8, 2024.
  27. ^ "Releases · arduino/arduino-ide · GitHub". GitHub. Retrieved 20 February 2024.
  28. ^ "It's here: please welcome Arduino IDE 2.0". 14 September 2022. Retrieved 12 November 2022.
  29. ^ Williams, Al (21 October 2019). "The Arduino IDE Finally Grows Up". Hackaday. Retrieved 26 October 2019.
  30. ^ "Introducing new Arduino Pro IDE with advanced features". Seed Studio. 21 October 2019. Retrieved 26 October 2019.
  31. ^ "Debugging Fundamentals". Arduino. 12 September 2024. Retrieved 26 September 2024.
  32. ^ "Arduino Board Package to Debug Uno/ATmega328P with CH552 debugger in Arduino IDE 2.0.0". Github. 9 September 2023. Retrieved 26 September 2024.
  33. ^ "add debug feature". Github. 28 February 2023. Retrieved 26 September 2024.
  34. ^ Programming Arduino Getting Started with Sketches. McGraw-Hill. Nov 8, 2011. ISBN 978-0071784221.
  35. ^ "Arduino - BareMinimum". www.arduino.cc. Retrieved 20 February 2018.
  36. ^ "setup() - Arduino Reference". www.arduino.cc.
  37. ^ "loop() - Arduino Reference". www.arduino.cc.
  38. ^ "pinMode() - Arduino Reference". www.arduino.cc.
  39. ^ "digitalWrite() - Arduino Reference". www.arduino.cc.
  40. ^ "delay() - Arduino Reference". www.arduino.cc.
  41. ^ "xinu-avr: The Xinu OS for AVR ATmega328P". se.fi.uncoma.edu.ar.
  42. ^ "xinu-arduino". October 9, 2022 – via GitHub.
  43. ^ Dunkels, A.; Schmidt, O.; Voigt, T. (2005). Using Protothreads for Sensor Node Programming. Proceedings of the REALWSN 2005 Workshop on Real-World Wireless Sensor Networks Presented at the REALWSN 2005 Workshop on Real-World Wireless Sensor Networks.
  44. ^ "FreeRTOS for Arduino". www.arduino.cc.
  45. ^ Beddows, Patricia A.; Mallon, Edward K. (2018-02-09). "Cave Pearl Data Logger: A Flexible Arduino-Based Logging Platform for Long-Term Monitoring in Harsh Environments". Sensors. 18 (2): 530. Bibcode:2018Senso..18..530B. doi:10.3390/s18020530. PMC 5856100. PMID 29425185.
  46. ^ Ali, Akram Syed; Zanzinger, Zachary; Debose, Deion; Stephens, Brent (2016-05-01). "Open Source Building Science Sensors (OSBSS): A low-cost Arduino-based platform for long-term indoor environmental data collection". Building and Environment. 100: 114–126. Bibcode:2016BuEnv.100..114A. doi:10.1016/j.buildenv.2016.02.010. ISSN 0360-1323.
  47. ^ Bardaji, Raul; Sánchez, Albert-Miquel; Simon, Carine; Wernand, Marcel R.; Piera, Jaume (2016-03-15). "Estimating the Underwater Diffuse Attenuation Coefficient with a Low-Cost Instrument: The KdUINO DIY Buoy". Sensors. 16 (3): 373. Bibcode:2016Senso..16..373B. doi:10.3390/s16030373. PMC 4813948. PMID 26999132.
  48. ^ Lockridge, Grant; Dzwonkowski, Brian; Nelson, Reid; Powers, Sean (2016-04-13). "Development of a Low-Cost Arduino-Based Sonde for Coastal Applications". Sensors. 16 (4): 528. Bibcode:2016Senso..16..528L. doi:10.3390/s16040528. PMC 4851042. PMID 27089337.
  49. ^ "Ars Electronica Archiv". Archived from the original on 2019-06-30. Retrieved 2015-03-27.
  50. ^ "Arduino Education nominated for Bett Award". Arduino Blog. 2020-01-20. Retrieved 2020-07-01.

Cite error: A list-defined reference named "smartprojects" is not used in the content (see the help page).
Cite error: A list-defined reference named "AutoF7-44" is not used in the content (see the help page).

Cite error: A list-defined reference named "freeduino" is not used in the content (see the help page).

Further reading

  • Banzi, Massimo; Shiloh, Michael (2022). Make: Getting Started With Arduino: The Open Source Electronics Prototyping Platform (4th ed.). Make Community. ISBN 978-1680456936.
  • Blum, Jeremy (2019). Exploring Arduino: Tools and Techniques for Engineering Wizardry (2nd ed.). Wiley. ISBN 978-1119405375.
  • Boxall, John (2021). Arduino Workshop: A Hands-On Introduction with 65 Projects (2nd ed.). No Starch Press. ISBN 978-1718500587.
  • Karvinen, Tero; Karvinen, Kimmo; Valtokari, Ville (2014). Make: Sensors (1st ed.). Make Community. ISBN 978-1449368104.
  • Monk, Simon (2018). Programming Arduino Next Steps: Going Further with Sketches (2nd ed.). McGraw-Hill Education. ISBN 978-1260143249.
  • Monk, Simon (2022). Programming Arduino: Getting Started with Sketches (3rd ed.). McGraw-Hill Education. ISBN 978-1264676989.
  • Nussey, John (2018). Arduino For Dummies (2nd ed.). John Wiley & Sons. ISBN 978-1119489542.
  • Purdum, Jack (2015). Beginning C for Arduino: Learn C Programming for the Arduino (2nd ed.). Apress. ISBN 978-1484209417.
  • Schmidt, Maik (2015). Arduino: A Quick Start Guide (2nd ed.). Pragmatic Bookshelf. ISBN 978-1941222249.
Historical