This is probably a bit of a newbie question, but I can't figure out how to change the size of the caption label text when using the native bitFont. I can see how to control other features of the bitFont and it is clear how to use controlFont, but that seems to work with an imported font. ControlP5 is great and well documented, so I am probably just overlooking something obvious. Can someone point to the right reference or show me a snippet?
I am new to using objects - the object in the code below came from a simpler sketch and was a function that worked correctly. The data comes in as strings from an Arduino. I want to move up to more complex data handling and so want to move up from a function to an object.
In the function sketch, the data is displayed correctly, but in the object sketch, the data is just zeros.
It appears that I am not correctly passing the data into the object or not calling calling for it to be displayed. Any observations?
code:
import processing.serial.*;
Serial port;
//import controlP5.*;
//ControlP5 control;
void setup()
{
size (640, 480);
port = new Serial(this, "COM3", 9600);
port.bufferUntil(';');
xDataDisplay = new DataDisplay(25, 25, coord_x);
yDataDisplay = new DataDisplay(25, 125, coord_y);
zDataDisplay = new DataDisplay(25, 225, coord_z);
}
void serialEvent(Serial port)
{
//the serialEvent parses the string sent by Arduino
//declare the serialEvent variables
String data = "";
int index_x = 0;
int index_y = 0;
int index_z = 0;
//read the data up to the semi-colon
data = port.readStringUntil(';');
//trim off semi-colon
data = data.substring(0, data.length() - 1);
//look for the x
index_x = data.indexOf("X");
//fetch the x coordinate
coord_x = data.substring(0, index_x);
//look for the y
index_y = data.indexOf("Y");
//fetch the y coordinate
coord_y = data.substring(index_x+1, index_y);
//look for the z
index_z = data.indexOf("Z");
//fetch the z coordinate
coord_z = data.substring(index_y + 1, index_z);
}