ADC user input in Simulation

Mad Professor

Senior Member
Good Day All.

In simulation how can I manual input more then once ADC value?

I know I can use the Generic arrors or input a value, but this gives me the same value on all the ADC inputs.

I can also click on the byte or word and enter a value, but when the next cycle of the program happends the value is wiped.

Can you please advice.

Thanks for your time.

Best Regards.
 

Mad Professor

Senior Member
BeanieBots: Thanks for your reply.

Does that mean it's can't yet be done one the fly?

I guess for now I will just have to hardcode it.
 

Technical

Technical Support
Staff member
One way is to use a #define at the top of your program that is commented out when you download to the real chip

Code:
#define in_simulation
 
readadc 1,b1
#ifdef in_simulation
b1 = 55
#endif
 
readadc 2,b2
#ifdef in_simulation
b2 = 155
#endif
 
etc.
 
Top