Introduction to Arduino

Install the arduino IDE
1. https://www.arduino.cc/en/Main/Software/
2. Select Linux 64 bit
3. Click Just Download

Unzip the downloaded file as below:
vbhadra@jupiter:~/Downloads$ tar -xf arduino-1.8.10-linux64.tar.xz

Run the arduino IDE
vbhadra@jupiter:~/Downloads$ cd arduino-1.8.10/
vbhadra@jupiter:~/Downloads/arduino-1.8.10$ ./arduino

Configure
1. Tools -> Board -> Board -> Arduino/Genuino Uno
Tools -> Port -> /dev/ttyACM0

Installing and uninstalling .zip user libraries in Arduino IDE
Install
Sketch -> Include Library -> Add .zip library
Uninstall
$ find ~/ -type d -iname Arduino
./Arduino
$ ls -la Arduino/
drwx—— 4 vbhadra vbhadra 4096 Oct 1 11:31 libraries
$ ls -la Arduino/libraries/
readme.txt SonysLPWA/ Vivek/

Remove the library folder you want to uninstall
$ sudo rm -rf Arduino/libraries/SonysLPWA/

Then modify your library code, create a .zip file and install it again.

Compile & verify the code
Sketch -> Verify & Compile
You should see “Done compiling”

Upload the code
Sketch -> Upload
You should see “Done Uploading”.

Troubleshooting
1. Issue 1:
An error occurred while uploading the sketchavrdude: ser_open(): can’t open device “/dev/ttyACM0”: Permission denied

-> Check if the port exist on the linux machine:

ls -l /dev/ttyACM*

-> Change the permission of the port as below:
sudo chmod a+rw /dev/ttyACM0

2. Junk characters in serial port

void setup()
{
  Serial.begin(9600);
  Serial.write("Hello World");
}

3. Mounting the SD card into the /mnt

mount -t vfat /dev/mmcsd0 /mnt

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s