how to set digital input in the simulator

cravenhaven

Senior Member
Simple test code to try and understand how to set a digital input.
If I click on the values tab in the simulation panel and then set pin C.3 to 255 I would expect the IF statement to be executed but it doesnt. If I hover over the pinC.3 statement it shows its value to be 0 regardless of what I type into the values table.
Same with the other input pins.

Code:
#picaxe 08M2

main:
	if pinC.3 = 1 then goto main
goto main
 

hippy

Senior Member
Just left click on the input pin of the chip diagram in the Simulation window. When the pin input is low it will be light grey, when high it will be yellow. Each click will toggle the state.
 

cravenhaven

Senior Member
Thanks Hippy that works of course :p.
So I guess that the semicircle that comes up when I right click on the pin is only used for analogue input, as are the values on the value tab?.
 

hippy

Senior Member
Yes; digital pin inputs read the (colour) status of the pins themselves.

Analogue byte value reads come from the right-click rotary slider or Byte Value entries, analogue word value reads come from the Word value entries.
 

binary1248

Senior Member
As along time user of PicAxe but seldom user of simulate, I learn something new every day.
Thanks for posting, and thanks hippy for the answer.
Paul
 
Top