We have been given the code below and was told that they ran it in Visual Studio.
We are looking for someone that can make a Visual Studio project for us so we can just open it and run the code. We would like the display to look nicer too.
Any questions, just ask.
Thanks you
//import Serial communication library
import processing.serial.*;
// Variable declaration
PFont font22, font44, font14;
PFont font12;
float tempC;
float tempF;
float y, h, BattV,Slave_ID, Byte1, Byte2, Byte3, Byte4, Byte5, Byte6, RSSI;
Serial USB_UART;
int i, j, xx=-15;
void setup() {
// Define size of window
size(350, 350);
//setup fonts for use throughout the application
font22 = loadFont("[login to view URL]");
font12 = loadFont("[login to view URL]");
font44 = loadFont("[login to view URL]");
font14 = loadFont("[login to view URL]");
//init serial communication port
USB_UART = new Serial(this, "COM6", 9600);
}
void draw() {
while ([login to view URL]() > 0)
{
Byte1 = [login to view URL]();
delay(20);
Byte2 = [login to view URL]();
delay(20);
Byte3 = [login to view URL]();
delay(20);
Byte4 = [login to view URL]();
delay(20);
Byte5 = [login to view URL]();
delay(20);
Byte6 = [login to view URL]();
background(250, 250, 250); // Light blue color
fill(200, 6, 0);
smooth();
stroke(0);
strokeWeight(2);
ellipse(100, 280, 58, 50);
noStroke();
fill(0, 46, 200);
arc(100, 60, 30, 20, PI, PI+PI);
rect(85,60,30,200);
fill(250,250, 250);
rect(95,60,10,200);
// Marks on thermometer
stroke(0);
strokeWeight(1);
textAlign(RIGHT);
fill(0,46,250);
for (int i = 0; i < 5; i += 1) {
line(70, 230-40*i, 80, 230-40*i);
if(i < 4) line(75, 210-40*i, 80, 210-40*i);
textFont(font12);
text(str(40+20*i), 65, 235-40*i);
}
textAlign(LEFT);
for (int i = 0; i < 6; i += 1) {
line(118, 242-35*i, 128, 242-35*i);
if(i < 5) line(118, 225-35*i, 123, 225-35*i);
textFont(font12);
text(str(0+10*i), 135, 247-35*i);
}
noStroke();
fill(0,46,250);
textFont(font22);
textAlign(LEFT);
text("F", 57, 46);
text("C", 135, 46);
textFont(font12);
text("o", 45, 35);
text("o", 125, 35);
fill(250,90,0);
textFont(font22);
text("o", 300+xx, 45);
text("o", 300+xx, 85);
// DS18B20 conversion
tempC = Byte4*256+Byte3;
tempC = tempC/16;
BattV = (Byte5+200)/100;
Slave_ID = Byte2;
tempF = ((tempC*9)/5) + 32; textFont(font44);
RSSI = Byte6;
text(nfc(tempC, 2), 200+xx, 60);
text(nfc(tempF, 2), 200+xx, 100);
text("C", 320+xx, 60);
text("F", 320+xx, 100);
textFont(font14);
text("Battery Voltage = V", 190+xx, 140);
text(nfc(BattV, 2), 313+xx, 140);
text("Signal Strength = ", 190+xx, 160);
text(nfc(RSSI,0), 313+xx, 160);
text("Slave ID = ", 190+xx, 180);
text(nfc(Slave_ID,0), 313+xx, 180);
// Raise mercury level
fill(200,0, 0);
y = -2.0*tempF + 310;
h = 270-y;
rect(95, y, 10, h);
}
}