Arduino Programming Language Articles - Page 4 of 10
5K+ Views
As the title suggests, in this tutorial, we will be listing the files stored in an SD Card connected to Arduino.Circuit DiagramThe circuit diagram is shown below −As you can see, you need to make the following connections −SD Card HolderArduino UnoVcc5VGNDGNDMISO12MOSI11SCK13CS10Only for the Vcc, make sure that your SD Card Holder takes 5V as input. If it takes in 3.3V, connect it to the 3.3V pin on Arduino Uno.Code WalkthroughWe will be walking through the example code that comes in with the inbuilt SD library. You can access it from File → Examples → SD → listfilesAlternatively, the code ... Read More
3K+ Views
In this tutorial, we will, as the title suggests, see how to append to a file in and SD Card connected to Arduino. Actually, it is quite simple. If you have gone through any previous articles on SD Card, then you only need to know thatmyFile = SD.open("example.txt", FILE_WRITE);opens example.txt in the append mode only. Thereafter, myFile.println(dataString);appends to the existing file, and doesn’t overwrite the existing content.If you haven’t gone through any other articles on SD Card, I’d suggest reading the "Store a new file in SD Card connected to Arduino" article. That is a detailed article containing the circuit ... Read More
2K+ Views
As the title suggests, in this tutorial, we will read a file from an SD Card connected to Arduino.Circuit DiagramThe circuit diagram is shown below −As you can see, you need to make the following connections −SD Card HolderArduino UnoVcc5VGNDGNDMISO12MOSI11SCK13CS10Only for the Vcc, make sure that your SD Card Holder takes 5V as input. If it takes in 3.3V, connect it to the 3.3V pin on Arduino Uno.Code WalkthroughWe will be walking through the example code that comes in with the inbuilt SD library. You can access it from File → Examples → SD → ReadWriteAlternatively, you can find the ... Read More
801 Views
In this tutorial, we will create a new file in an SD Card connected to Arduino Uno.Circuit DiagramThe circuit diagram is shown below −As you can see, you need to make the following connections −SD Card HolderArduino UnoVcc5VGNDGNDMISO12MOSI11SCK13CS10Only for the Vcc, make sure that your SD Card Holder takes 5V as input. If it takes in 3.3V, connect it to the 3.3V pin on Arduino Uno.Code WalkthroughWe will be walking through the example code that comes in with the inbuilt SD library. You can access it from File → Examples → SD → DataloggerAlternatively, you can access the code on ... Read More
723 Views
The Arduino Uno board looks like the following −As you can see, the pins are broadly divided into 3 sections. Two sections at the bottom of the image, and one at the top.Let us look at the bottom sections.Section 1The first section contains power pins.The Vin pin can be used if you are using an external power source (and not the USB) to power the board. The recommended voltage range is 7-12 V.The 3.3V and 5V pins provide 3.3V and 5V outputs respectively, and should be used to power other components using the Arduino board. The maximum current from the ... Read More
532 Views
In this tutorial, we will connect our Arduino Uno to an SD Card and extract the card info.Circuit DiagramThe circuit diagram is shown below −As you can see, you need to make the following connections −SD Card HolderArduino UnoVcc5VGNDGNDMISO12MOSI11SCK13CS10Only for the Vcc, make sure that your SD Card Holder takes 5V as input. If it takes in 3.3V, connect it to the 3.3V pin on Arduino Uno.Code WalkthroughWe will be walking through the example code that comes in with the inbuilt SD library. You can access it from File → Examples → SD → CardInfoWe begin with the inclusion of ... Read More
1K+ Views
A problem faced by several people using Arduino, or any microcontroller board for that matter, is that you may forget to start the Serial Monitor before programming the board, and miss some print statements by the time you open the Serial Monitor.One way to overcome this is to start the sketch only after an input is received from the user, via the Serial Monitor. This will ensure that you don’t miss any prints on the Serial Monitor because of the delay in starting the Serial Monitor.Examplevoid setup() { // put your setup code here, to run once: Serial.begin(9600); ... Read More
1K+ Views
The Serial Monitor of Arduino has a text box at the top, through which, users can send in text to the Arduino board.The text can be read by Serial.read(). Also, the Serial.available() function can be used to check if there is any data to read. It returns the number of characters or bytes available for reading, i.e., the number of bytes stored in the serial receive buffer.ExampleUsing these functions, let’s create a simple echo program for Arduino. The code for the same can be found below −void setup() { // put your setup code here, to run once: ... Read More
2K+ Views
In this article, we will walkthrough the example code in Arduino, which helps generate the ASCII table in the Serial Monitor output. For your reference, this is what the ASCII table looks like − http://www.asciitable.com/It contains the character, followed by its ASCII code in decimal, hexadecimal, and sometimes, even octal and binary representations. In this example, we will print out all these representations for printable ASCII characters. Remember that the first printable ASCII character starts from number 33, and the printable characters go on up to number 126. Since we will print out the ASCII table on the Serial Monitor, ... Read More
1K+ Views
In case you don’t want to overwrite a string, but just change a character at a specific position, Arduino provides the setCharAt() function exactly for that.SyntaxString1.setCharAt(ind, new_char);String 1 is the string to modify. ind is the index where the character needs to be set. new_char is the value of the new character that needs to be set.This function returns nothing, and modifies the string in place.ExampleThe following example illustrates the use of this function.void setup() { // put your setup code here, to run once: Serial.begin(9600); Serial.println(); String string1 = "Hello World!"; Serial.println(string1); string1.setCharAt(4, ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP