Hi Everyone.
I am creating a hedgehog feeder that uses an RFID module to scan our microchipped hedgehogs to open up the feeder for them. I want to exclude rats and our hungry dog from the food.
The module outputs a 29 bit message in a char I have called 'incoming'.
You might have to read between the lines a bit as I am learning and this project is a mix of Decimal, ascii and hexadecimal so is confusing to me.
Within 'incoming' positions 1 to 10 are the animal ID number and positions 11 to 14 are the country number.
An example animal number is 171A9253A3 in base 16.
The number I would like the arduino to produce is 250000032921.
The method of translating this is
1x16^0 = 1
7x16^1=112
1x16^2=256
A or 10 x 16^3=40960
etc etc
3x16^9= 206158430208
Sum all those values together = 250000032921
I had the code working and would correctly spit out the country code that is only four digit long but the animal number of 12 digits would come out completely wrong.
Am I right in saying the arduino just can't cope with doing sums on 12 digit values?
After resigning myself to having the arduino output 171A9253A3 as an output that is ok for my project to work. I just use excel to do the calculation to the final value.
For my second question...
The values within the char 'incoming' are 29 individual values.
I would like to pluck out the individual values in locations 1 to 10 and munge them together into one variable (maybe a string?) such that 1,7,1,A,9,2,5,3,A,3 just becomes a bit of text 171A9253A3. Then I can more easily compare that with the known text from known hedgehog numbers eg If mystring = 171A9253A3 hedgehog = "Spike"). I know I have written that wrongly as I am still learning but hopefully you understand what I am trying to achieve. Then if it is Spike rather that Greedy dog the arduino will open the feeder.
Later as I also want to get one of my backlit LCD display to show up 'Spike' so that our security camera can record which hedgehog it is being video'd.