Week 08

Embedded Programming.

The board I use for Fab Academy is ELEGOO UNO, it is similar to an Arduino UNO (it works the same) but it is not. Arduino is an open-source microcontroller so some companies develop their own microcontrollers. Both boards are based on the same chip, ATmega328P. These microcontrollers have 14 digital input/output pins, 6 PWM outputs (Pulse Width Modulation), 6 analog inputs, a 16 MHz ceramic resonator, USB connection, a power jack, an ICSP header and a reset button.


Datasheet.

Datasheets are instruction manuals for electronic components, and it is always important to read the manual. It shows the performance and other characteristics of the microcontroller. It explains the pin configuration (down) to know the functions of each pin so to understand how to use the microcontroller, security recommendations, voltage specifications, connection diagrams, etc.

The ATmega328P is a low power, CMOS 8-bit microcontroller based in the AVR enhanced RISC architecture, which means that it offers the highest capability available in the 8-bit MCU market. It operates with a 3.3V-5.5V supply, although the commonly used is 5V.

arduino pinout

Programming the board.

I had never used Arduino before, not even connect one to my computer but it turned out that it is easy to use once someone explains how to use it. For the first example I opened the exercise code and connect the arduino as the tutorial states, and run the code. I connected the LED to pin 9 because the example instructed that and connected it to 5V. Note: check that the correct board is selected in Arduino, otherwise nothing will happen.

blink

For the second example, I changed the blink for fading. I followed this tutorial, left the LED connected to pin 9 because that's what the tutorial stated and played a little with the delay to be able to distinguish between fadings.

fade

Libraries.

For the use of libraries I decided to use the piezo buzzer that came with my kit and try something with sound. Libraries add functions for the use of sketches and contain extra definitions. Libraries use the extension .h so in my case I followed this tutorial that explains the need of a library called pitches.h and how to save it as a library (copy in new file >> save as .h). The next step was to start modifying the main sketch according to the notes I wanted to use. The tutorial explains that NOTE_C4 is middle C. NOTE_FS4 is F sharp, and so forth, so you will find it useful when making musical notes. So as you will see in the video below I added the notes to play the beginning of the kid's song "Martinillo". SOUND ON!

fade

Student

Elsa Garduño

Date

03.25.2020

Category

Fab Academy

Share