Go Down

Topic: Getting Bytecode off SD card (Read 1 time) previous topic - next topic


Hello all

I have been really impressed with the arduino so far
For one of  my projects I will be generating a Jpeg image and saving it onto an sd card
Is the Arduino able to read the RAW bytecode of the file as hex and then squirt it down a serial stream as ascii e.g. ED E5 65 54

I thought that as an arduino can decode a text file then therefore it can read the raw bytes
I am a newbie though so I may not be seeing the proper picture

I am using the arduino uno and the ladyada SD shield
Thanks for your time  :)



yes, just feed data to your arduino slowly.
guida per principianti
Unoffical Telegram group


Hi Thanks for your reply

How do you mean "slowly"?
Is there a function which does this for me??


i don't know how much, there are some SDFat benchmark where you can find the maxvalue for your SD

and, yes, there are funcion to save byte to SD, but you have to read the input (another file, serial, i2c, etc...) and call the SD.h function.
guida per principianti
Unoffical Telegram group


I have been using the SD libs to read out text files (datalogging). I also want to read out from the SD card (somehow) a Jpeg file that can be redecoded by the pc.

I have tried using the standard file read function but the arduino interprets the Jpeg file as text. This then corrupts the file as it is transmitted down the serial stream and cant be decoded by the pc. Is there a way that I can bypass the SD lib text encoder and just get the raw bytes out of it? (Preferably in Hex)


Ok. I think that I have made some progress, I have replaced the Serial.write() function with serial.print(data,HEX). This is printing the file out in HEX. Still not sure weather I am getting non corrupt files though. I am using Hex Editor Neo to decode the files.


you are confused. binary, octal, decimal, hexadecimal, are different way to read the same data. it is ard to read 11111111 but it easy to read FF.
whan you use print you are writing the ASCII rapresentation if the binary value into anoter rapresentation.

Yoor coe with write was right, you just have to be sure to open the file (to write AND to read) as binary
guida per principianti
Unoffical Telegram group

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131