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
|