ide arduino

parent 3eb21c5f
Pipeline #76894 passed with stage
in 17 seconds
......@@ -67,8 +67,82 @@
Once the ISP is recognized, programming could begin.<br>
<br><h2>Languages and software</h2>
The microcontrollers use different programming languages such as the assambler, the C++ and even some softwares use a modification of some programming languages, such as the one used by Arduino.
The microcontrollers use different programming languages such as the assambler, the c ++ and even some softwares use a modification of some programming languages, such as the one used by the Arduino hardware.<br>
<br><h3>IDE Arduino</h3>
A very recommendable software to program microcontrollers in a simple way and with hundreds of examples on the internet, is the Arduino IDE. It is a free and widely used hardware worldwide.
<a title="Arduino IDE"><img class="image center" src="images/week9/idearduino.jpg"></a>
The software is free download, from<a href="https://www.arduino.cc/en/Main/Software"> this link</a> which can be installed on both Windows, Mac and Linux. In my case I use windows.
After installing the IDE, the first step is to install the necessary libraries to be able to program in the Attiny44, which is the microcontroller that I will use. The process can be seen in the following picture.
<a title="Arduino Boards"><img class="image center" src="images/week9/arduinoboards.jpg"></a>
<br><h4>Code</h4>
Then I write my first code, a basic blink of a couple of seconds on and off.
<pre><code>int led1=7;
void setup() {
pinMode(led1,OUTPUT);
}
void loop() {
digitalWrite(led1,HIGH);
delay(3500);
digitalWrite(led1,LOW);
delay(2000);
}</pre></code>
In the loading process, you can see the video of the steps to follow, as well as its operation.<br>
Additionally, I have created a couple of programs that will be shown below, the first is the lighting of a led using a push button and the second code is the LED lighting after pressing 4 times to turn it on.<br>
<br><h5>Button</h5>
<pre><code>int led1=7;
int button=3;
int state;
void setup() {
pinMode(led1,OUTPUT);
pinMode(button,INPUT);
}
void loop() {
state=digitalRead(button);
if(state==HIGH){
digitalWrite(led1,LOW);
}
else{
digitalWrite(led1,HIGH);
}
}</pre></code>
<h5>Test button</h5>
<pre><code>int button = 3;
int led1 = 7;
int buttonPushCounter = 0;
int buttonState = 0;
int lastButtonState = 0;
void setup() {
pinMode(led1,OUTPUT);
pinMode(button,INPUT);
}
void loop() {
buttonState = digitalRead(button);
if (buttonState != lastButtonState) {
if (buttonState == HIGH) {
buttonPushCounter++;
}
else {
}
}
lastButtonState = buttonState;
if (buttonPushCounter % 4 == 0) {
digitalWrite(led1, HIGH);
} else {
digitalWrite(led1, LOW);
}
}</pre></code>
<h4>Configuration and Upload</h4>
Working.
</p>
<!-- <p>
<h2>Download files</h2>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment