Go Down

### Topic: Need help for an Arduino project (Read 1 time)previous topic - next topic

#### ardly

#30
##### Feb 11, 2018, 06:49 pm
Presumably you know how to convert between binary and hexadecimal?
Each hexadecimal character respresents exactly 4 bits, as per the list below.

0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111

From that I guess you can see how the first line of the QR code was represented in hexadecimal?

F            E           B           B          F           8           0          0
XXXX   XXXO   XOXX   XOXX   XXXX   X000   0000   0000

Here are some questions you should try to answer;

What are the advantages and disadvantages of storing a version 1 QR code in arrays of each of these variable types

• bool
• unsigned char
• unsigned long (32 bit)
"Facts do not cease to exist because they are ignored" - Aldous Huxley

#### sungjung

#31
##### Feb 27, 2018, 01:48 pm
Yes, we know how to convert binary to hexadecimal.

For us, the bool variably type is the best one, the others being unnecessary complicated for the task we have to complete.

We gonna try to take some pictures but we have to make the cabling first.

#### wvmarle

#32
##### Feb 28, 2018, 06:17 am
For us, the bool variably type is the best one, the others being unnecessary complicated for the task we have to complete.
Even being unable to figure out what you really want, I can tell you that this is 99.999% certainly a VERY bad decision.

21x21 bit QR code in bools = 441 bytes of storage. 6 of them = 2646 bytes
That's a lot of memory out of your 8096 total bytes available! Plus the complications of dealing with such 2D arrays.

The long solution: 21x4 = 84 bytes per code, or 504 bytes for six of them. Very easy to work with, as it's a 1D array and a single variable per row.

Using three separate bytes for each row (of course that's a 2D array again) could bring down the storage requirements to just 63 bytes per code, or 378 bytes total.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

#### ardly

#33
##### Feb 28, 2018, 04:45 pm
....
We gonna try to take some pictures but we have to make the cabling first.
I agree with @wvmarle's last post.

Initially I used bool so that you would be able to 'see' the the QR code within the initialised array.
To actually solve this problem I would use 32 bit variables, but it is not just about the amount of storage it is also about how you can process the variables.

You first posted about this in Jan with a deadline of May. It is now Mar and you have not taken pictures yet. Really I have to advise that as this rate you will not complete this project.

1. Take the pictures in a standard reproducable way - trivial
2. Convert the picture into an array - moderate
3. Decode the array to 'read' the QR code - moderate/difficult

Have you actually investigated picture file formats and how you would read them to produce an array containing the QR code?

Do you understand how data is encoded in a QR code and how you would extract the data from it?

Extracting data from a QR code involves a lot of bit manipulation. It should not be that difficult but it could take you a while to understand the documentation. The fact that you are considering using bools makes me believe you have not thought about how you would program the task.

You really need to get a move on if you hope to do this by May and it will involve hard work.

"Facts do not cease to exist because they are ignored" - Aldous Huxley

Go Up