Hot answers tagged

18

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 you use a different pin for the slave select (SS) on each SPI device. When you want to talk to one slave, you hold its SS low and drive the other high. Do the ...


11

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 instruction of the author of SDFat library from this post. According to fat16lib, to increase the data rate we need to use flush() wisely. We would want to write() the ...


9

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 closing the file on the SD card.


9

SCK stands for SPI ClocK CLK stands for SPI CLocK Two different acronyms for the same thing.


8

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 Clock MOSI (SD-DI, DI) : SPI Master out Slave in MISO (SD-DO, DO) : SPI Master in Slave out CD: Card Detect (see comment of rollinger below (thanks). On an ...


5

EDIT: As noted by Klaus Warzecha, the SD library may only support 8.3 format filenames (i.e. 8 characters for the name, 3 characters for the extension). The solution may in fact be to ensure that the years is only 2 digits, resulting in names like: 20-12-14.csv From what I can see in the SD library code, the open() method isn't designed to accept a String ...


5

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 setFileParameter(const char *filename, int value) { ... }


5

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 on Arduino ---> Pin 11 VCC to 3.3V source on Arduino GND to Arduino Ground Try that first and see how you get on. By the way, just thought I'd mention, ...


5

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


5

The pre requisites for windows10 are not met on your device. You cannot get that done on your hardware.


5

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 big enough for one (32-bit) integer. And you then get an "easy" way of accessing that one integer within that buffer. Another way would be to just use a ...


4

You're creating a directory, and then not writing the file into it. You need to change the filename to /DCIM/100NIKON/DSCN0000.JPG"; Note that SD.open() takes the full filepath to the file, not just the file*name*. From the Arduino Docs: The file names passed to the SD library functions can include paths separated by forward-slashes, /, e.g. "...


4

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' characters. write is printing the ascii character associated with the binary value (the new line). You need to parse the ascii characters into numbers. Luckily for ...


4

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 buffer to the SD card and empty the buffer so you can start filling it again. That writing to the SD card takes time - lots and lots of time (relatively), and ...


4

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 things. Another option seems you mentioned LEDs, you could still use the I²C bus and use an I/O expander and hook LEDs up to that and address them over the I²...


4

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 use compatibility function with the standard SD Library. Try it out. 2. Your Hardware You should use a high class SD Card. As you maybe know SD Cards are ...


4

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've just fixed it out. The problem is the handshake when you call the SD.write(). Instead: //for each loop, it is going to make a handshake while(<...


4

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 signifies an ASCII character. Your code will get the letters to display and for each one will do something like this: byte BrailleBytes[] = {0x01, 0x05, 0xD, ...


4

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 is a representation of characters into a "shape" that many systems don't recognise. Most people only encounter Braille when they press a button on an elevator ...


4

The program you link to does not take over pins 3, 9, 10 and 11, it takes over Timer 1 and Timer 2, which are used to provide PWM capability on those pins. This means you cannot do analogWrite() on those pins anymore, but you still can use them for other purposes, including SPI access to an SD card. Note, however, this line of code: int speakerPin = 11; // ...


4

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, which itself is like EEPROM in concept. You may possibly have problems with storing the notes in RAM, and then writing them to the SD card fast enough not to lose some. ...


4

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. This will take 16 * 2 (raw data + 3 bytes for the pulse data = 35 bytes per 16 samples, meaning 35 bytes/samples * 20 samples/s = 700 bytes (I think your ...


4

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 faster transfers.) Note that SD card run at 3.3Volt, not 5V. Also the input pins of the SD can't handle 5Volt signals. So you need to convert the 5V signals coming ...


3

You have to parse the character array in order to convert it to floats. There is no fast way to do this: since the Arduino has no FPU, anything involving floats is slow. Unless you really have to, I would not recommend slurping the whole file into RAM. You will save memory by parsing the file on the fly. This should be as simple as calling the parseFloat() ...


3

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-with-video-experimenter-shield/


3

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) will return true if a card is present and false when it's not.


3

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 caused me no end of headaches trying to figure out.


3

Open-source is just great. Lets have a look at the source code for SD. Here is what happens on write of a block. /** * Write data to an open file. * * \note Data is moved to the cache but may not be written to the * storage device until sync() is called. * * \param[in] buf Pointer to the location of the data to be written. * * \param[in] nbyte ...


3

My problem with that is that the other side of the diode on the Arduino is normally powered up. So for example if you have a 12V supply in the power jack you'll have 11.3V at Vin (because of the diode drop). Thus you are pumping 11.3V into your 9V battery which won't be designed to handle it. It will probably get hot and explode. You would need another ...


3

No, when you have 9V hooked up to Vin and 5V coming in from the USB, it will use power from the 9V battery, not usb and the battery will quickly be depleted.


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