Number TO Hex
Moderator: Benj
Number TO Hex
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
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
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Number TO Hex
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
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
Re: Number TO Hex
Hi Benj
Just made the test, i think this needs some more attention see Attachment
.
Just made the test, i think this needs some more attention see Attachment

- Attachments
-
- before-After.png
- (26.51 KiB) Downloaded 7396 times
Re: Number TO Hex
Hi
I have overwritten the original file , can someone upload AVR_CAL_String.c please
Thanks in advance .
I have overwritten the original file , can someone upload AVR_CAL_String.c please
Thanks in advance .
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Number TO Hex
Hopefully this will help.
Martin
Martin
- Attachments
-
- AVR_CAL_UART.c
- (61.94 KiB) Downloaded 410 times
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Number TO Hex
Hi Alan,
i have posted the original file as requested.
Not modified it at all.
Martin
i have posted the original file as requested.
Not modified it at all.
Martin
Martin
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: Number TO Hex
Hi Alan,
Try this ..
Try this ..
- Attachments
-
- AVR_CAL_String.c
- (23.57 KiB) Downloaded 414 times
Re: Number TO Hex
Hi Leigh
Yesss that Fixed it , please include this in the update .
Thanks very much .
Alan
Yesss that Fixed it , please include this in the update .
Thanks very much .
Alan
- Attachments
-
- Fixed.png
- (10.88 KiB) Downloaded 7306 times