Skip to main content
Senior
February 19, 2024
Solved

I cant assign a value to variable

  • February 19, 2024
  • 1 reply
  • 2568 views

Hi,

I am trying to assign Adc.Raw[0] and Adc.Raw[1] to Vref and Vtemp as in below code snippet. But, Vref and Vtemp gets 0. These variables never updated with Adc.Raw values.

Could you please point me in the right direction ?

demir_0-1708356711425.pngdemir_1-1708356733689.png

 

This topic has been closed for replies.
Best answer by demir

Thanks Andrew.

I suspect it is a bug, as it is working now.

demir_0-1708357674250.png

 

1 reply

Andrew Neil
Super User
February 19, 2024

The assignment is inside an 'if' - was that code actually executed?

What did your printf output show?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
demirAuthorBest answer
Senior
February 19, 2024

Thanks Andrew.

I suspect it is a bug, as it is working now.

demir_0-1708357674250.png

 

Tesla DeLorean
Guru
February 19, 2024

>>I suspect it is a bug, as it is working now.

Real hard to know with very limited screen shots of code. Troubleshooting problems like this through the key-hole isn't going to garner much assistance. It's usually not with the code you choose to show.

Provide code in a reviewable / editable manner. Attach code using the code formatting tool </>, or as attached file(s), or preferably a github repo.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..