Re: Encoding and generating QR Codes

Sorry to bring up an old thread but i am trying to achieve similar goal.

Please can anyone advice why I would get result which doesnt match what is in the .ino file?
I am also supplying rest of the files and running this on nano. Thank you.

P1
21 21
1 1 1 1 1 1 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 
1 0 0 0 0 0 1 0 1 1 1 0 1 0 1 0 0 0 0 0 1 
1 0 1 1 1 0 1 0 0 0 1 1 1 0 1 0 1 1 1 0 1 
1 0 1 1 1 0 1 0 1 1 0 0 1 0 1 0 1 1 1 0 1 
1 0 1 1 1 0 1 0 0 1 0 0 1 0 1 0 1 1 1 0 1 
1 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 1 
1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 
1 1 1 1 1 0 1 1 1 0 0 1 0 1 0 1 0 1 0 1 0 
0 1 0 0 1 1 0 1 0 0 1 1 1 0 0 0 1 1 1 0 1 
1 0 1 1 1 1 1 1 0 0 1 0 1 0 1 0 0 1 1 1 0 
0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 1 0 1 1 0 0 
0 0 1 1 1 1 1 1 0 1 1 0 1 0 1 0 0 1 0 1 0 
0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 1 0 1 1 1 
1 1 1 1 1 1 1 0 1 1 1 1 0 1 0 0 0 1 0 1 0 
1 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 1 1 1 1 1 
1 0 1 1 1 0 1 0 1 1 1 1 0 0 1 1 0 1 0 0 1 
1 0 1 1 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 0 
1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 0 0 0 1 0 0 
1 0 0 0 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 0 
1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 0 0 0 1 0

My data match this too

I think I am eligible for a bump now, can anyone please help me with the issue, or point me towards a way I can resolve it.

Thank you.

Please can anyone advice why I would get result which doesnt match what is in the .ino file?

What result did you get? You have given so little information no wonder no-one answered.

Hi Nick, I am using the same code that was mentioned in the thread(I see now that it is separated- thank you)
This code, from post #9
http://forum.arduino.cc/index.php?topic=303434.msg2176874#msg2176874

And I am expecting the data to be same as mentioned in the sample result which is in the program. wanted to verify it before I use for my scenario.

I am using arduino 1.6.5 just in case.

What is the question?

I am expecting the data to be same as mentioned in the sample result

Is it or isn't it? If not, what did you get? And what did you expect?

@saiko: I used the code you linked to in message #3.
I did not need to change anything and it produced this output on a NANO with IDE 1.6.9:

P1
21 21
1 1 1 1 1 1 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 
1 0 0 0 0 0 1 0 1 1 1 0 1 0 1 0 0 0 0 0 1 
1 0 1 1 1 0 1 0 0 0 1 1 1 0 1 0 1 1 1 0 1 
1 0 1 1 1 0 1 0 1 1 0 0 1 0 1 0 1 1 1 0 1 
1 0 1 1 1 0 1 0 0 1 0 0 1 0 1 0 1 1 1 0 1 
1 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 1 
1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 
1 1 1 1 1 0 1 1 1 0 0 1 0 1 0 1 0 1 0 1 0 
0 1 0 0 1 1 0 1 0 0 1 1 1 0 0 0 1 1 1 0 1 
1 0 1 1 1 1 1 1 0 0 1 0 1 0 1 0 0 1 1 1 0 
0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 1 0 1 1 0 0 
0 0 1 1 1 1 1 1 0 1 1 0 1 0 1 0 0 1 0 1 0 
0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 1 0 1 1 1 
1 1 1 1 1 1 1 0 1 1 1 1 0 1 0 0 0 1 0 1 0 
1 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 1 1 1 1 1 
1 0 1 1 1 0 1 0 1 1 1 1 0 0 1 1 0 1 0 0 1 
1 0 1 1 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 0 
1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 0 0 0 1 0 0 
1 0 0 0 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 0 
1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 0 0 0 1 0

Pete

Oh, I see your problem now. The output, in my previous message, does not match what the comment in the .ino file says it should be.
I'll look at it to see if I can figure out why it is different.

Pete

I looked into QR codes a while back. One thing about them is that there is not one exact output for a given input. Presumably an algorithm should always give the same result if run twice, but for a particular code there are variations in the way it lays down the patterns, in order to achieve the best contrast between 0 and 1.

It is possible that the algorithm was improved at some point, but they didn't change the comment in the .ino file. For more discussion see here:

You're right, Nick.
I decoded the pattern and it gives the same text as the original in the .ino file.

Pete

I've now tried to decode the original QRcode data in the .ino file and it does not decode at all. I don't know where I got that from. It is just an alternating pattern of 1010101 etc.
I'll add a message to the end of the original thread so that people don't get misled again.

Thanks
Pete

Thank you Pete and Nick, sorry I couldn't get back early.

I will try this again this weekend and update this thread.