Hot answers tagged

23 votes
Accepted

How to access multiple SPI interfaces on Arduino

Assuming you just want to connect two SPI slave devices to the SPI bus and use them in a mutually exclusive way under software control, with the Arduino as the master, then you just need to make sure ...
12 votes
Accepted

How to increase SD card write speed in arduino

OK. So, I tried the SDFat lib. This library is definitely better than the default SD library that comes with adruino. But that is not how I solved my problem of low data-rate. I followed the ...
10 votes

Use LED on pin 13 again after using the SD library

It is possible to use the LED on pin 13 again by disabling the SPI bus that is used by the SD library to read/write data to/from the SD card. To disable the SPI bus, simply call SPI.end() after ...
10 votes

How to use a microSD card reader with SCK instead of CLK?

SCK stands for SPI ClocK CLK stands for SPI CLocK Two different acronyms for the same thing.
  • 104k
8 votes

What do these pins mean? Where should I plug them in?

This is called the SPI interface (See Serial Peripheral Interface, Wikipedia. The pin names typically used for SPI are: GND : Power Ground VCC : Power input CS : Chipselect SCK/SCLK (SD-Clock): SPI ...
6 votes
Accepted

How can I do web hosting having all the code of the site stored in a sd?

You wrote: the site does not have to be static but constantly updated with new temperature data. A good option is to use Ajax. The basic idea is to split the site in two parts: a static part, ...
  • 39.2k
5 votes
Accepted

Serial.write and Serial.println return different values? Cannot use correct ones

The text file contains the sequential ascii values that spell out the data, not binary data. println in printing the numerical value of each byte. For example, the 10's println prints are '\n' ...
  • 4,360
5 votes
Accepted

How to pass a filename to a function? What type of variable is the filename?

String literals are of type const char *. Ordinary char *s can be passed to it though; the const means that the compiler will make sure that the function doesn't attempt to change the contents. void ...
5 votes
Accepted

SD card fails to initialize

The first thing to try is to use the 'proper' pins for the SPI: SCK to Pin 10 on Arduino ---> Pin 13 CS to Pin 11 on Arduino ---> Pin 10 MISO to Pin 12 on Arduino ---> Pin 12 MOSI to Pin 13 ...
5 votes
Accepted

What is the best way to get more RAM for a sound buffer?

A simple SPI SRAM chip. Available up to 128KB, such as the 23LC1024: http://www.microchip.com/wwwproducts/en/23LC1024
  • 104k
5 votes
Accepted

Need help with 2X3 matrix for braille

First of all, may I say "Thank you" for helping your friend like that? I cannot think of a better way to use an Arduino than as a driver for a Braille display like you describe! As you know, Braille ...
5 votes
Accepted

Writing "theremin" outputs to a MIDI file on an SD card

The short answer would be "yes, it is possible". There are lots of gadgets around that record MIDI. They would have microprocessors in them, and they would have something like an SD card, ...
  • 35.7k
5 votes
Accepted

Reading bytes from a file on SD Card - Understanding Buffer

You don't have to, it's just one way of doing it. Basically the read function needs a pointer to a buffer to store the data in. By using an array with one entry you get a pointer to a buffer that is ...
  • 104k
4 votes
Accepted

Signal sampling: losing data every 103 points when it is recorded in SD

It's all to do with writing to the SD card. You have a buffer of 512 bytes which is one "block" of the SD card. When you have written to the card enough to fill that buffer up it has to write that ...
  • 104k
4 votes

One free pin. Need to display output for the user?

Seems you have I²C on the board you could possibly use an I²C LCD backpack, like from breakouts if you already have an LCD, this means you can have the RTC and display on the I²C bus and probably more ...
  • 1,437
4 votes

How to increase SD card write speed in arduino

Many factors would decide if you can reach this wanted speed. Only some of these. 1. Your Software The SdFat Library is faster than the standard SD Library of the Arduino IDE. It also has an easy to ...
4 votes

How to increase SD card write speed in arduino

Avoid the handshake getting a buffer! Use SD.write(buf,size); Hi every one, I'm working in a project with the same issue. I was following the same steps of yours and got exactly the same numbers. I'...
  • 41
4 votes

Need help with 2X3 matrix for braille

Each character will be 6 bits (so let's use a byte to store it) and we'll use the following bit to LED mapping bit0 bit1 bit2 bit3 bit4 bit5 Now you just need an array of bytes where each byte ...
4 votes
Accepted

Understanding why should avoid “String” and alternative solutions

First, let me point out a problem in your code, completely unrelated to your question: AcX = Wire.read()<<8|Wire.read(); The C++ standard does not specify in which order the two reads will be ...
  • 39.2k
4 votes

Understanding why should avoid “String” and alternative solutions

Edgar answers your first question about String and printing very nicely. Majenko also has a nice description here of the pitfalls. Regarding your second question about GPS/efficiency/speed: use ...
  • 2,009
4 votes

Using a Micro SD card for data logging, bad idea? Reliable?

We've been maintaining a network of loggers (60+ currently deployed) using SD card connected directly to the SPI pins (see: http://www.mdpi.com/1424-8220/18/2/530 for details) and our experience is ...
  • 101
4 votes

Arduino SD Card open file modes append / overwrite

The Arduino SD library is an Arduino wrapper of old version of SdFat library (put into utility subfolder of the SD library). This SdFat library has constants like O_READ, O_WRITE, O_APPEND. Arduino ...
  • 17k
4 votes

Arduino SD Card open file modes append / overwrite

You only need to open the file with FILE_WRITE and use file.seek(EOF) to go to de end of the file. After that you can write whatever you want that will be appended to the end of the file. File ...
4 votes

Writing to sd card with a sampling rate 50ms or less? I have a sketch that writes to sd every 1s but jams at faster sampling rates. Please help?

Some tips: Do not open the open and close the file in every loop sequence (I think you can use the flush command to save/update the file. Do not save strings, but save the raw data and pulse string. ...
4 votes

What do these pins mean? Where should I plug them in?

CS = Chip select DI = Data In (MOSI) VCC SCK = Serial Clock GND DO = Data Out (MISO) CD (not sure what it stands for, but this pin isn't used when connecting to an Arduino. I think it's used for ...
  • 11.2k
3 votes

What is the difference between file.print() and file.write()

The File class inherits from the Stream class, which in turn inherits from the Print class. The Serial class inherits from the Stream class, which in turn inherits from the Print class. print() and ...
  • 104k
3 votes
Accepted

SD.begin() fails second time

I know this question is relatively old but still, if you wnat to run SD.begin(chipselect); again first call if(root.isOpen()) root.close(); I added this to the library. This way SD.begin(chipselect) ...
3 votes

Record video with CMOS camera using Arduino

Arduinos have two major drawbacks: Not enough memory. Way too slow. There's a shield to help you do that: http://nootropicdesign.com/ve/ http://blog.arduino.cc/2011/03/24/arduino-computer-vision-...
  • 1,551
3 votes

using seek() in Arduino to go to the end of a variable-sized file

You can only seek to an absolute position from the start of the file. Fortunately there is the size() method that can tell you where the end is, though. file.seek(file.size());
  • 104k
3 votes

Using TMRpcm library, the audio does not play

This is now 5 months later - but I recently had the same problem. Because the TMRpcm library plays through pulse width modulation, make sure your speakers are hooked up to a PWM capable pin. That ...

Only top scored, non community-wiki answers of a minimum length are eligible