Go Down

Topic: Virtual Breadboard VBB3 Analog Input Problem? (Read 2738 times) previous topic - next topic

P1000

Hello Community,
I am a total Newbe and just now ordered my first Arduino Uno.
Since I hardly can wait for it to arrive, I searched for a virtual Arduino application and found it in VBB3.
My first virtual setup includes 5 Analog Inputs, and here is were my Problem starts.
It seems that VBB3 only registers the input voltage at Analog pin 0, no matter which pin I monitor it always gives me the voltage of pin 0.
Did someone had a similiar problem? And is there a workaround?

Greetings

Marco..


doublet

Maybe post your code so we can help you...
Sorry God members, I'm an atheist.

P1000

Certainly I can post some code I used....

Quote

const int JOYPIN_X = A0;
const int JOYPIN_Y = A1;
const int JOYPIN_Z = A2;
const int STEERPIN = A3;
const int GASPIN = A4;
const int POSRESET = 12;
const int ENGINEKILL = 9;

// Define Outputs
const int STEERMOTPOS = 11;
const int STEERMOTNEG = 10;
const int GASMOTPOS = 6;
const int GASMOTNEG = 5;
const int FRONTPROPPOS = 8;
const int FRONTPROPNEG = 7;
const int KILLSWITCH = 4;
// Define Thresholds
const int X_TOL = 10;
const int Y_TOL = 10;
const int Z_TOL = 510;

void setup()
{
  Serial.begin(9600);
  pinMode(STEERMOTPOS, OUTPUT);
  pinMode(STEERMOTNEG, OUTPUT);
  pinMode(GASMOTPOS, OUTPUT);
  pinMode(GASMOTNEG, OUTPUT);
  pinMode(FRONTPROPPOS, OUTPUT);
  pinMode(FRONTPROPNEG, OUTPUT);
  pinMode(KILLSWITCH, OUTPUT);
  pinMode(POSRESET, INPUT);
  pinMode(ENGINEKILL, INPUT);
  digitalWrite(POSRESET, HIGH);
  digitalWrite(ENGINEKILL, HIGH);
}
void loop()
{
  //Get Input Values
  int JOYXNOW = analogRead(JOYPIN_X);
  int JOYYNOW = analogRead(JOYPIN_Y);
  int JOYZNOW = analogRead(JOYPIN_Z);
  int STEERNOW = analogRead(STEERPIN);
  int GASNOW = analogRead(GASPIN);
    
  
  //Compare Values   
    if (JOYXNOW + X_TOL <= STEERNOW) {
    Serial.println("LEFT");
 } else if (JOYXNOW - X_TOL >= STEERNOW) {
    Serial.println("RIGHT");
 }
}


Go Up