티스토리 뷰

반응형

Since 2017, I would like to start new IoT Project based on Arduino hardware platform. So far I used to make IoT solution with RaspberryPI 2B and Windows 10 IoT core and finally uploaded my own project to Hackers.io site. Everyone can read and look at the project and take it to follow. By the way more people are interested in Arduino due to easiness. Therefore I decided to use Arduino in order to make new project and get these knowledge. Today, I am about to explain how to start Arduino I mean What should I use the board, IDE and how to flash the program into Arduion. Let's start it now!.

# Open Hardware Platform, 'Arduino'

A few weeks ago, I went to one of high school to be a mentor for high school students who want to learn Arduino programming. Already they have been learning and doing their own project but needed some touching like going to be better project. I was assigned almost two teams to complete and I also learnt Arduino environment how to use it and program. Once I download IDE for arduino on this site.

https://www.arduino.cc/en/software

 

Software

Open-source electronic prototyping platform enabling users to create interactive electronic objects.

www.arduino.cc

 

According to own host PC specification, we can get IDE, it's very light and portable. In my case, I choose linux version to use in my host PC. I can get arduino-1.8.0 version(1/2/2017 base) and install. If you unzip the file you can see more files related to work for Arduino IDE and install.sh is able to set up all things for my host PC like shorcut and others.

You can find out two parts when you run IDE in your PC which are 'setup and loop' functions. setup will be called just one time when the program runs and then loop function will be called permernantely because it is kind a super routine. As you know Arduino AP is littbit lower specification than RaspberryPI2 therefore you dont have to expect various functionalities it will be big burden.

# How to flash the code into my Arduino

If you coded setup and loop function correctly once you need to check compilation and then flash the code to Arduino via USB cable. If you plug correct USB cable, the Arduino will be connected and see the port well.

Look the picture and see the menu when you select tools. Like I said, we can find out port and board correctly if the usb cable is plugged correctly. The left side of the check button if you click, the codes will be compiled and see the result at the bottom of the IDE. and '->' buttone if you click, the code will be flashed into Arduino. Wow. Its super comportable. Let's do it right now and see the result how to change the built-in LED on Arduino. Every 1 second, the LED will be turned on and turned off.

# Trouble shotting.

When I flash the code to Arduino, I faced 'permission denied' issue regarding port. How to tackle the issue? IDE is running by user but your linux device is working on special group. In my ttyACM0 device is ruuing by dialout group. Let's follow the below comand to fix.

$sudo usermod -a -G dialout <username>

$sudo chmod a+rw /dev/ttyACM0

If you do this at least once you can flash your code without any problem.

 

Okay, wrap it up today. Today we tested with Arduino and IDE how to flash the code and use IDE. The next time we will do more like sensor and motors with Arduino for my 1st of 2017 project.!! Bye Bye

 

반응형

'Technology > Arduino' 카테고리의 다른 글

[Project] Pet Feeder with Arduino + EV3  (0) 2017.02.12
WIFI + WebServer + Arduino + LED control  (0) 2017.01.31
EV3 + Arduino connection via I2C  (0) 2017.01.22
Actuator control - SG90  (0) 2017.01.15
ISR or Falling??  (0) 2017.01.11
댓글