I posted a
threadearlier to help me get started on this, and got some help. Now, I have made some headway. I can now get the "joystick" to snap back to the midpoint of the umbrella image. Now the tricky part is going to be getting the xVal and yVal to output "good" data through the serial port to the servos.
Furthermore, there will be a laser attached to the pan & tilt, which will point at an object on a wall. When it reaches said object, the program will display a different main image and a list image with selectable options for right and wrong answers.
Any advice would be helpful...
Here's what I have so far:
int ellipseSize = 70; int screenXSize = 1920; int screenYSize = 1080; int midUmbrellaX = 1750; int midUmbrellaY = 910; int xVal = 0; int yVal = 0; PImage umbrella; PImage selection; PImage stars; PImage spectrum; PImage spectra; int value = 0;
void setup() { size(screenXSize, screenYSize); frame.removeNotify(); frame.setUndecorated(true); umbrella = loadImage("Umbrella_Corporation_logo.jpg"); // Load the image into the program selection = loadImage("Grocery-List.jpg"); stars = loadImage("absorptionspec.jpg"); spectrum = loadImage("types_of_spectra.jpg"); spectra = loadImage("spectra.jpg "); }
I am working on a project and need a little help. I will have 3 working areas eventually. The umbrella area will have a "joystick" that will control 2 servos through arduino. Right now I am just trying to draw an ellipse in the umbrella area and be able to move it only withi the area of that image, and then have it spring back to the center of that image.