# About the Processing / Beginners category

**URL:** <https://discourse.processing.org/t/about-the-processing-beginners-category/25>\
**Category:** Beginners\
**Created:** [May 12, 2018, 4:50am UTC](https://discourse.processing.org/t/about-the-processing-beginners-category/25 "2018-05-12T04:50:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ProcessingOrg](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/processingorg/32/18341_2.png) [@ProcessingOrg](https://discourse.processing.org/u/ProcessingOrg)\
**Post date:** [May 12, 2018, 4:50am UTC](https://discourse.processing.org/t/about-the-processing-beginners-category/25/1 "2018-05-12T04:50:14Z")

</div>

Questions and discussions for people starting out with Processing

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [March 28, 2019, 5:59pm UTC](https://discourse.processing.org/t/about-the-processing-beginners-category/25/2 "2019-03-28T17:59:43Z")

</div>



---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [March 28, 2019, 5:59pm UTC](https://discourse.processing.org/t/about-the-processing-beginners-category/25/3 "2019-03-28T17:59:51Z")

</div>



---

<div class="post-metadata">

**Author:** ![Vodin](https://avatars.discourse-cdn.com/v4/letter/v/74df32/32.png) [@Vodin](https://discourse.processing.org/u/Vodin)\
**Post date:** [November 21, 2023, 7:02pm UTC](https://discourse.processing.org/t/about-the-processing-beginners-category/25/5 "2023-11-21T19:02:07Z")

</div>

Hi, I Try to do a radar. But now I have an error: frame cannot be resolved to a variable. May be I have problems with my libryries or something like that. I believe you guys. If it will help the radar consist of: 2 ultrasonic sensors, 1 servo, 1 arduino nano. And here is the code:  
import processing.serial._;  
import static javax.swing.JOptionPane._;

Serial myPort; // The serial port  
String serialin;  
int data = new int[360];  
PFont f;

final boolean debug = true;

void setup() {  
String COMx, COMlist = “”;  
size(1280, 720);  
f = createFont(“Verdana”, 32, true); // Arial, 16 point, anti-aliasing on  
textFont(f, 20);  
frameRate(60);  
for (int i = 0; i \< 360; i++) {  
data[i] = 0;  
}  
try {  
if (debug) printArray(Serial.list());  
int i = Serial.list().length;  
if (i != 0) {  
if (i \>= 2) {  
// need to check which port the inst uses -  
// for now we’ll just let the user decide  
for (int j = 0; j \< i; ) {  
COMlist += char(j+‘a’) + " = " + Serial.list()[j];  
if (++j \< i) COMlist += ", ";  
}  
COMx = showInputDialog(“Which COM port is correct? (a,b,…):\n”+COMlist);  
if (COMx == null) exit();  
if (COMx.isEmpty()) exit();  
i = int(COMx.toLowerCase().charAt(0) - ‘a’) + 1;  
}  
String portName = Serial.list()[i-1];  
if (debug) println(portName);  
myPort = new Serial(this, portName, 9600); // change baud rate to your liking  
myPort.bufferUntil(‘\n’); // buffer until CR/LF appears, but not required…  
} else {  
showMessageDialog(frame, “Device is not connected to the PC”);  
exit();  
}  
}  
catch (Exception e)  
{ //Print the type of error  
showMessageDialog(frame, “COM port is not available (may\nbe in use by another program)”);  
println(“Error:”, e);  
exit();  
}  
}

void draw() {  
background(26, 26, 36, 200);  
textSize(18);  
stroke(255, 255, 255, 150);  
fill(255, 50, 200, 200);  
text(“Arduino RADAR 2D Visualization”, 20, 710);  
text(hour(), 1050, 710);  
text(“:”, 1075, 710);  
text(minute(), 1085, 710);  
text(“:”, 1110, 710);  
text(second(), 1120, 710);  
fill(36, 255, 100, 200);  
strokeWeight(3);  
circle(640, 360, 600);  
circle(640, 360, 500);  
circle(640, 360, 400);  
circle(640, 360, 300);  
circle(640, 360, 200);  
circle(640, 360, 100);

for (int i = 0; i \< 360; i++) {  
fill(255, 10, 255, 200);  
stroke(50, 10, 255, 150);  
point(float(640) + (map\_values(data[i]))\*cos(radians(i)), float(360) + (map\_values(data[i]))\*sin(radians(i)));  
}

while (myPort.available() \> 0) {  
serialin = myPort.readStringUntil(10);  
try {  
String serialdata = splitTokens(serialin, “,”);  
if (serialdata[0] != null) {  
serialdata[0] = trim(serialdata[0]);  
serialdata[1] = trim(serialdata[1]);  
serialdata[2] = trim(serialdata[2]);

```
    int i = int(serialdata[0]);
    data[179-i] = int(serialdata[1]);
    data[(179-i)+180] = int(serialdata[2]);
  }
} 
catch (java.lang.RuntimeException e) {
}

```

}  
}

float map\_values(float x) {  
float in\_min = 0, in\_max = 200, out\_min = 0, out\_max = 700;  
return (x - in\_min) \* (out\_max - out\_min) / (in\_max - in\_min) + out\_min;  
}
