Running the VBB emulator from arduino

HI everyone,

First of all I am new to arduino and the emulator, so my skills are pretty bad and also my vocabulary, i will try to be as clear as possible.

I have developed a little application in arduino, and I have also the VirtuaBreadBoard software with arduino license for running arduino stuff in it. Now, here I found this video

And I want to do the same.

I cannot make the communication between arduino and the VBB.

If I import an arduino sketch into the VBB software, and I try to recompile it to emulate the behaviour of the circuit and the microcontroller, it does not work. To my understanding, the VBB compiler runs in java and the commands are not the same as C. But how can I directly run the emulator from Arduino then?

In the manual of VirtualBreadBoard software I read that the ICEshield is needed, is it another board to attach to the arduino? how does it work?please please help me people, I need to have an emulator for my project because I don’t want to buy real components yet and i dont want to compile my app code in java in the VBB compiler!

I can also post the code if it is needed.

Thank you very much!

Sorry guys,
just to be clear.
I am using the Arduino UNO, and here’s the code i have developed so far.

#define sensorPin 0
int button = 2; // acquiring button on pin 2
int pin1 = 8;
int pin2 = 9;
int pin3 = 10;
int state;
int buttonState;
float Celsius, Fahrenheit, Kelvin, comparison, ambtemp, reset;
int sensorValue;
void setup() {

Serial.begin(9600);
Serial.println(“Acquiring temperature…”);

pinMode(pin1, OUTPUT);
pinMode(pin2, OUTPUT);
pinMode(pin3, OUTPUT);
pinMode(button, INPUT);
digitalWrite(button,HIGH);
}
void loop() {
GetTemp();
state = digitalRead(button);

// read the input pin:
int buttonState = digitalRead(button);
// print out the state of the button:
Serial.println(buttonState);
delay(500); // delay in between reads for stability

if (state == 0)
{
reset = comparison;
}
Serial.print("Celsius: ");
Serial.println(Celsius);
Serial.print("Fahrenheit: ");
Serial.println(Fahrenheit);
Serial.print("Comparison: ");
Serial.println(comparison);
Serial.print("Resetted value by driver: ");
Serial.println(reset);
Serial.print("Comparison - reset: ");
Serial.println(comparison-reset);
Serial.print("state: ");
Serial.println(state);
Serial.println();

if ((comparison-reset) <= -30.0)
{
digitalWrite(pin1, HIGH);
digitalWrite(pin2, LOW);
digitalWrite(pin3, LOW);
}
if ((comparison-reset) >= -30.0 & (comparison-reset) <= 30.0)
{
digitalWrite(pin1, LOW);
digitalWrite(pin2, HIGH);
digitalWrite(pin3, LOW);
}
if ((comparison-reset) >= 30.0)
{
digitalWrite(pin1, LOW);
digitalWrite(pin2, LOW);
digitalWrite(pin3, HIGH);
}
delay(200);
}
void GetTemp()
{
ambtemp = 18;
sensorValue = analogRead(sensorPin); // read the sensor
Kelvin = (((float(sensorValue) / 1023) * 5) * 100); // convert to Kelvin
Celsius = Kelvin - 273.15; // convert to Celsius
Fahrenheit = (Celsius * 1.8) +32; // convert to Fahrenheit
comparison = Celsius - ambtemp;
}

basically I am comparing 2 temperatures and showing the difference on 3 leds, with a button to acquire a good temperature balance. It’s for a baking oven.

CHEERS!!

The video demo on this page seems a bit more relevant to your needs and does not seem to need the shield.
I don't have the VBB software of arduino plug-in so cannot help much more.

davide007:
If I import an arduino sketch into the VBB software, and I try to recompile it to emulate the behaviour of the circuit and the microcontroller, it does not work. To my understanding, the VBB compiler runs in java and the commands are not the same as C. But how can I directly run the emulator from Arduino then?

Seems to me that this question should be addressed to the support community for VBB.

ok guys, thanks for you help anyway.

cheers :slight_smile: