I have 4 pressButtons on my Arduino that are sending serial signal when they are on or off.
I need to have the 4 different signals doing 4 different things on processing (e.g. change background color).
So far I can send the signal properly from Arduino to Processing, but I can't wrap my mind around how to use those signals to do different things in processing.
I tried to see if there were other threads on this topic but I couldn't find one (if there are, please post the link)
Any help would be very much appeciated!
Thank you all so much in advance!
BTW: the basic sketch for processing is this:
// Example by Tom Igoe
import processing.serial.*;
Serial myPort; // The serial port
void setup() {
// List all the available serial ports
println(Serial.list());
// I know that the first port in the serial list on my mac
// is always my Keyspan adaptor, so I open Serial.list()[0].
// Open whatever port is the one you're using.
myPort = new Serial(this, Serial.list()[0], 9600);
}
void draw() {
// Expand array size to the number of bytes you expect
In here cubes rotate on both axes and by themselves.
What I would like to have is something like this:
if there is no motion, then cubes stand still
if I move my mouse on the Y axis, then cubes near by the mouse rotate faster, and the more fare away from the mouseY cubes are, the slowest they rotate.
At this point, if I don't move my mouse, after a while all cubes stops rotating (cubes that rotate faster will stop later).
I really don't know how to start this, I am quite a newbie in 3D interactivity, and in processing in general.
I wanted to experiment with typography with Processing.
What I wanted to do was to display characters on a grid. The posisioning assign to the characters is defined but not fixed. Let me just show you this image
In this case for example the first J is the first letter of a four letter word. This means that the character can appear in whichever position in the grid but whith these conditions:
1. it should appear in the second or in the third row (now it's in the second)
2. it should not appear in the first or the last column (this should be fairly easy)
3. it should appear in whichever of the other columns but it has to leave room for the following three letters, so it can be displayed only in the 2nd, 3rd, or 4th column.
4. it should not appear in the gutters(the smaller columns)
So on for the other letters.
It seems to me that I have to create a two dimensional array populated by objects containing the characters... But I have no clue if this sounds any logic and - if so - how to go on...