Hot answers tagged

22

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 ...


12

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

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 ...


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

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

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

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

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 performed. This may work well with the particular version of the particular compiler you are using, but it can break the day you (or an update to the Arduino ...


4

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 NeoGPS, use AltSoftSerial, use the MPU FIFO, use the up-to-date SdFat, watch out for SD write delays, and close the log file at some point. 1. NeoGPS is the ...


4

You cannot SD cards cannot be shared between masters in operation, and it is unsafe to disconnect the card from the camera with an electronic switch when the camera is not expecting that. Nor is an ordinary Arduino fast enough to passively snoop the data being written to the card by the camera (while a card will let an Arduino write to it quite slowly, any ...


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

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 ...


4

You can write the file in chunks. As suggested by ocrdu in a comment, writing line by line is a good strategy. In order to keep the complexity of the code manageable, I would put the logic of deciding the color of a pixel in its own function, and use another function for managing writing the bitmap. For example: struct Pixel { uint8_t r, g, b; }; // ...


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

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() ...


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