-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGettingStarted.txt
More file actions
90 lines (61 loc) · 4.58 KB
/
Copy pathGettingStarted.txt
File metadata and controls
90 lines (61 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
***********SETUP***********
---Installing Arduino IDE---
The arduino IDE is relatively easy to install, all that is needed to be done was to go to Arduinos download page and download
the 64 bit version for Linux. To install the ide, you must first go to the path of where it was downloaded using the CD
command in the terminal, the use the command ./install.sh
One final step in order to give the Arduino usb privileges, is to type the following command into the terminal.
sudo adduser USER dialout
sudo usermod -a -G dialout $USER
(Replace USER with your user name, but DO NOT erase the $ sign)
Now we should have no problems uploading code onto the arduino through the USB port.
Connecting The Arduino to the IDE
First connect the Arduino to the PC using the USB wire.
Now within the Arduino IDE, go to Tools > Board: > Arduino Uno. Also go to Tools > Port > choose the appropriate port to your
usb port. Now the Arduino will be connected to the IDE and we will be able to transfer code onto it through the USB port.
---Testing first piece of code---
It is essential that we test a piece of test code so that we know that the Arduino and Linux can communicate properly with
eachother. First open the Arduino IDE. Click File > Examples > 01. Basics > Blink.
This will open a pre-writtin program that simply causes an LED light on the board to blink at a certain speed. Click the
check mark at the top of the screen (Verify), then click the arrow (Upload). Observe the Arduino terminal at the bottom of
the window. If there is no errors, then we are good to go!
Also look at the Arduino, it should have an orange LED blinking.
***********SOFTWARE***********
Writing code for the Arduino The language that will be used for code the Arduino is C/C++, and a basic understanding of it is
needed in order to write any code for it. When writing the code, there is two sections for where the code is to be read by
the Arduino
void setup() is the first section. This section is where you would define any settings for the Arduino to maintain throughout
the program. void loop() is the second section. This section is the piece of code that is repeated endlessly until the
program is complete.
***********HARDWARE***********
There are many components to the Arduino’s hardware, but it is rather simple. Since this document will be more directed at
the understanding of the Arduino, we will only talk about the most important pieces of hardware in the Arduino. We will focus
on the pins, microcontroller, and the power source.
---Pin Descriptions---
The pins are the small black pieces on the sides of the Arduino Uno. They have a hole in them, allowing you to connect a wire
to them.
Vin: Input voltage to Arduino when using an external power source.
5V: Regulated power supply used to power microcontroller and other components on the board.
3.3V: 3.3V supply generated by on-board voltage regulator. Maximum current draw is 50mA.
GND: Ground pins.
Reset: Resets the microcontroller
Pins A0-A5: These are analog pins. Analog pins let you measure a varying voltage that is being received by the pin, rather
then a regular digital pin would just indicate boolean values.
Digital Pins 0-13: These pins can be used as input or outputs, uses boolean values.
AREF: Provides a reference voltage for input voltage.
---Special Pins---
Pins 0(Rx), 1(Tx): Used to receive and transmit TTL serial data. These pins can be looked at as Receivers and Transmitters of
data, like an in and out.
PWM Pins(3,5,6,9,10,11): PWM pins are the pins with a ~ beside them. PWM is Pulse-Width Manipulation, on a very basic level,
PWM attempts to imitate analog with the use of digital pins by turning the power on and off very quickly.
---Microcontroller---
The microcontroller is the “brain” of the Arduino. The microcontroller that the Arduino uses is called ATmega328P and
contains 32kb of flash memory. 2kb of SRAM, and 1kb of EEPROM. The clock speed of the microcontroller is 16MHz.
---Power Source---
USB port: The USB port uses an A-Male to B-Male cord (the same one you would use for a printer). The USB port is used to
transfer data from the PC to the Arduino, but it also has the ability to feed 5V to the Arduino.
Barrel Power Jack: This is an alternative power source to the USB port. It also can supply %V to the Arduino.
***********References***********
https://components101.com/microcontrollers/atmega328p-pinout-features-datasheet
https://components101.com/microcontrollers/arduino-uno
https://learn.sparkfun.com/tutorials/serial-communication/wiring-and-hardware
https://www.digikey.com/en/articles/designing-in-usb-type-c-and-using-power-delivery-for-rapid-charging