Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Digital pin state display problems? (Read 4456 times)
FrankP
Full Member
***
Offline


Posts: 245
Joined: Oct 19th, 2011
Digital pin state display problems?
Dec 31st, 2014 at 2:37am
Print Post  
I have the 'paid' version of visual micro with the very cool debugging utilities, but I'm having some trouble with the digital pin state display when working with my Arduino Uno sketch using Visual Studio 2008.

In my setup() function, I set pins 1, 3, and 5 to inputs, and everything else to output.  When I run my sketch using the Virtronics simulator, the digital pins are shown as being set up correctly.  However, when I run the same sketch with Visual Micro with my Uno attached, the digital readout shows 7, 13, and 15 as inputs (I'm assuming here that 'red' is an output, and 'green' is an input).

Any idea why this is happening?

The setup code:

    //Set OUTPUT pins to drive the left wheel motor
    pinMode(LeftMotorSpeedPin,OUTPUT);
    pinMode(LeftMotorDirPin1,OUTPUT);
    pinMode(LeftMotorDirPin2,OUTPUT);

    //Set OUTPUT pins to drive the right wheel motor
    pinMode(RightMotorSpeedPin,OUTPUT);
    pinMode(RightMotorDirPin1,OUTPUT);
    pinMode(RightMotorDirPin2,OUTPUT);

    //Setup forward HC-SRS04 ultrasonic sensor
    pinMode(FrontSensorTrigPin,OUTPUT);
    pinMode(FrontSensorEchoPin,INPUT);

    //Setup forward HC-SRS04 ultrasonic sensor
    pinMode(LeftSensorTrigPin,OUTPUT);
    pinMode(LeftSensorEchoPin,INPUT);

    //Setup forward HC-SRS04 ultrasonic sensor
    pinMode(RightSensorTrigPin,OUTPUT);
    pinMode(RightSensorEchoPin,INPUT);

    //get initial distance readings
    prevfrontdistval = GetDistanceCm(FrontSensorTrigPin, FrontSensorEchoPin);
    prevleftdistval = GetDistanceCm(LeftSensorTrigPin, LeftSensorEchoPin);
    prevrightdistval = GetDistanceCm(RightSensorTrigPin, RightSensorEchoPin);

I have attached two images; one from Virtronics showing its idea of the digital I/O setup, one from the Visual Micro debugger.  both were obtained using the exact same sketch.

Any clues would be appreciated.

Frank
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Digital pin state display problems?
Reply #1 - Dec 31st, 2014 at 3:45am
Print Post  
Hi, red means Low and green means High. The digital display is not aware of input,output. It simply returns the value of digital read.

We are planning some enhancement to the visualizations.

Does this explain things?
  
Back to top
IP Logged
 
FrankP
Full Member
***
Offline


Posts: 245
Joined: Oct 19th, 2011
Re: Digital pin state display problems?
Reply #2 - Dec 31st, 2014 at 3:54am
Print Post  
Thanks for the quick response - and yes, it does explain what I'm seeing.

I would like to add my vote to the idea of providing I/O as well as LOW/HI visualization.  As I'm sure you are aware, Virtronics does this by physically separating the I/O designations (colored text - red for OUTPUT, green for INPUT) from the LOW/HI designations (white dot for low, red dot for HI) and this is very intuitive.   

Come to think of it, this may be what got me in trouble with your display, as I expected something similar Wink

Regards,

Frank
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Digital pin state display problems?
Reply #3 - Dec 31st, 2014 at 2:51pm
Print Post  
Ok I will put it on the list thanks
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint