Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
Hello! I actually have kind of a weird problem . . . So I have two different programs (one an example program, one that's running essentially the same code with some additional functionality) and I'm trying to run the same line of code with the same input values but I'm getting different results, which is a bit concerning. Below is the line of code:
Pretty straight forward, trying to take a float stored in dutycalc and turn it into a char array for the LCD.
On a working program, my data buffer comes out correctly. Assuming a calculated duty cycle of 50, I get the following:
dispbuff  0x1FFF81CC (All) char 
0 32 ' ' 0x1FFF81CC (All) char
1 53 '5' 0x1FFF81CD (All) char
2 48 '0' 0x1FFF81CE (All) char
3 46 '.' 0x1FFF81CF (All) char
4 48 '0' 0x1FFF81D0 (All) char
5 48 '0' 0x1FFF81D1 (All) char
6 0 '\000' 0x1FFF81D2 (All) char
7 0 '\000' 0x1FFF81D3 (All) char
On a non working program (same line of code, same duty cycle value of 50), I get the following:
dispbuff  0x1FFF81E8 (All) char 
0 32 ' ' 0x1FFF81E8 (All) char
1 0 '\000' 0x1FFF81E9 (All) char
2 128 '\200' 0x1FFF81EA (All) char
3 46 '.' 0x1FFF81EB (All) char
4 0 '\000' 0x1FFF81EC (All) char
5 32 ' ' 0x1FFF81ED (All) char
6 0 '\000' 0x1FFF81EE (All) char
7 0 '\000' 0x1FFF81EF (All) char
I honestly have no idea why the same code can act differently on two different projects. I'm going to attach my "non-working" project here for anyone who wants to take a look at it (no idea if there's a simple explanation or if there's some sort of conversion library I should've added that would make this work correctly). Any help you can give me would be greatly appreciated! Thanks!
Wow, I would never have even thought to check that menu . . . looks like there are more sections I need to examine when setting up projects with snippets of code from example projects . . . thanks again!