【发布时间】:2016-11-25 23:41:50
【问题描述】:
我有一个背景图片,我希望用户认为他们正在通过Processing 与之交互。图像上有一个单词列表,当用户单击单词周围的区域时,我希望播放声音并将序列号发送到 Arduino。
除此之外,我无法正确获取 mousePressed 代码。我现在正在使用println("yikes") 对其进行测试,现在无论我在屏幕上的哪个位置单击都会得到“yikes”。
除此之外,我还遇到了一些我无法弄清楚的错误。帮助表示赞赏。
void setup() {
size(1475, 995);
// The image file must be in the data folder of the current sketch
// to load successfully
img = loadImage("PaceTaker.jpg"); // Load the image into the program
}
void draw() {
// Displays the image at its actual size at point (0,0)
image(img, 0, 0);
}
void mousePressed() {
if (mouseX>105 && mouseX<337 && mouseY>696 && mouseY<714);
{
println("yikes");
stroke(0);
}
else println("hello"));
}
【问题讨论】:
标签: if-statement arduino mouseevent processing