When facing an unknown thing, we should first clarify what it “is”, then understand what it can be used for, and finally learn why it exists.
What is Arduino?
To know is to know, to not know is to “Baidu” it.
Arduino is a convenient, flexible, and easy-to-use open-source electronic prototyping platform, which includes hardware (various models of Arduino boards) and software (Arduino IDE), developed by a European team in the winter of 2005. (Quoted from Baidu Encyclopedia)
Arduino is a set of electronic production standard kits based on microcontrollers, which encapsulates various complex hardware circuits and hardware-based programming, allowing electronics enthusiasts to engage in electronic production and development with just basic circuit knowledge and programming languages.
Basic Arduino C Programming
-
The two most important functions in Arduino C language
loop() function, is the main function of Arduino, which will repeatedly execute this function after powering on, has no return value, and is a dead loop function.
-
Functions for operating digital ports in Arduino
pinMode(13, OUTPUT); // Set digital port 13 as outputpinMode(4, INPUT); // Set digital port 4 as input
digitalWrite(13, HIGH); // Digital port 13 outputs high leveldigitalWrite(13, LOW); // Digital port 13 outputs low level
if(digitalRead(4)==HIGH) // If digital port 4 is high level{……}
-
Functions for operating time in Arduino
delay(n) function, is used to delay n milliseconds.
delay(1000); // Delay 1 second
delayMicroseconds(100); // Delay 100 microseconds
void setup(){pinMode(13, OUTPUT); // Set digital port 13 as output}void loop(){ digitalWrite(13, HIGH); // Set digital port 13 to high level delay(500); // Delay 0.5 seconds digitalWrite(13, LOW); // Set digital port 13 to low level delay(500); // Delay 0.5 seconds}
Limitations of Arduino
After saying so much, you may have a preliminary understanding of Arduino. As time goes by and the subsequent tutorials deepen, more and more techniques and libraries will be used, and the characteristics of Arduino being easy to get started will be fully demonstrated. However, this does not mean that Arduino has no drawbacks. For beginners with no experience, Arduino is a magical tool because Arduino is a platform, not a specific microcontroller, and the learning cost and difficulty are very low. However, from a practical application perspective, Arduino is more suitable for DIY, idea validation, rapid prototyping of products, etc., and is clearly not suitable for actual product production because of its low operational efficiency, lack of debugging support, and inexplicable conflicts and errors that may occur when using certain hardware resources (timers, interrupts, etc.). Therefore, Arduino ignites your passion, but having interest alone is not enough; more importantly, you need to put in effort and study the underlying principles of circuits and algorithms.
That’s all.
Leave a Comment
Your email address will not be published. Required fields are marked *