Number TO Hex

A forums to allow resolved bugs and problems with Flowcode v7 to be stored and marked as resolved.

Moderator: Benj

Post Reply
User avatar
Alan_37
Posts: 179
Joined: Sun May 01, 2016 8:36 pm
Has thanked: 51 times
Been thanked: 54 times
Contact:

Number TO Hex

Post by Alan_37 »

Hi

Just found a small bug , when converting Number to hex string
for 1 to 9 in the simulation shows that hex string is 0x01 to 0x09
but than when you burn to the chip the string is 0x1 to 0x9 , it took me while
trying to find what is wrong cause i was comparing the
Hex string to another string , in simulation worked perfectly but on chip
dose not .

Chip is : Atmega2560 ( Arduino Mega2560 R3)

So hope you can fix it thanks .

Alan

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Number TO Hex

Post by medelec35 »

Hi Alan,While you are waiting for that to be sorted, have you see this?

Martin
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Number TO Hex

Post by Benj »

Hello,

Please can you try this updated CAL file and see if it solves the problem for you. It should now force the number to have at least two characters e.g. "0x01" instead of "0x1"

The file needs to be placed into the "Flowcode 7/CAL/AVR" directory before recompiling your project.
AVR_CAL_String.c
(23.5 KiB) Downloaded 343 times

User avatar
Alan_37
Posts: 179
Joined: Sun May 01, 2016 8:36 pm
Has thanked: 51 times
Been thanked: 54 times
Contact:

Re: Number TO Hex

Post by Alan_37 »

Hi Benj

Just saw the post to day ,
I have fixed the problem by cutting the 0x then check the string length if = 1 then hex_string = "0" + hex_string .

But i will certainly replace the cal file make some test and let you know .

Thanks very much .

Alan

User avatar
Alan_37
Posts: 179
Joined: Sun May 01, 2016 8:36 pm
Has thanked: 51 times
Been thanked: 54 times
Contact:

Re: Number TO Hex

Post by Alan_37 »

Hi Benj

Just made the test, i think this needs some more attention see Attachment :| .
Attachments
before-After.png
(26.51 KiB) Downloaded 7396 times

User avatar
Alan_37
Posts: 179
Joined: Sun May 01, 2016 8:36 pm
Has thanked: 51 times
Been thanked: 54 times
Contact:

Re: Number TO Hex

Post by Alan_37 »

Hi

I have overwritten the original file , can someone upload AVR_CAL_String.c please

Thanks in advance .

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Number TO Hex

Post by medelec35 »

Hopefully this will help.

Martin
Attachments
AVR_CAL_UART.c
(61.94 KiB) Downloaded 329 times
Martin

User avatar
Alan_37
Posts: 179
Joined: Sun May 01, 2016 8:36 pm
Has thanked: 51 times
Been thanked: 54 times
Contact:

Re: Number TO Hex

Post by Alan_37 »

Thanks medelec

But still no luck

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Number TO Hex

Post by medelec35 »

Hi Alan,
i have posted the original file as requested.
Not modified it at all.

Martin
Martin

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Number TO Hex

Post by LeighM »

Hi Alan,
Try this ..
Attachments
AVR_CAL_String.c
(23.57 KiB) Downloaded 321 times

User avatar
Alan_37
Posts: 179
Joined: Sun May 01, 2016 8:36 pm
Has thanked: 51 times
Been thanked: 54 times
Contact:

Re: Number TO Hex

Post by Alan_37 »

Hi Leigh

Yesss that Fixed it , please include this in the update .

Thanks very much .

Alan
Attachments
Fixed.png
(10.88 KiB) Downloaded 7306 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Number TO Hex

Post by LeighM »

Hi Alan,
Thanks for the confirmation, the file is now in our repo ready for next update/release.
Regards,
Leigh

Post Reply