Globals vs. Locals for ADC.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Globals vs. Locals for ADC.

1,817 次查看
FWFan
Contributor III
Hi All,
 
I tried to use global (before main) to hold my ADC capture but it does not work.
But if I use local, the ADC result would be stored sucessfully.
Do you guys have any thoughts?
The reason I need to store my ADC globally is because I will need
to transfer it when I do my IIC isr.
I'm including my code for reference.
 
Thank you,
FWFan
标签 (1)
0 项奖励
回复
2 回复数

779 次查看
eckhard
Contributor V
Hello,

maybe it helps to declare your global variable as volatile


Eckhard
0 项奖励
回复

779 次查看
FWFan
Contributor III
Thank you Eckhard.
I will try that tonight.
 
FWFan
0 项奖励
回复