Arduino & Processing - no error message, just no sign of any input
in
Integration and Hardware
•
2 years ago
There are no error messages when I try to read inputs from my arduino Uno board, but there's no sign of any input, either! I've connected a series of sliders, buttons and switches to my board in what I believe is exactly the same configuration I used with a previous board. I've uploaded the StandardFirmata arduino sketch to both of the ports that only appear in my list from println(Arduino.list()); although it throws me that they are listed as
- [0] "/dev/tty.usbmodem621"
- [1] "/dev/cu.usbmodem621".
I also switched between arduino = new Arduino(this, Arduino.list()[0], 115200); and arduino = new Arduino(this, Arduino.list()[1], 115200); since for reasons I've never really understood I've found that I usually need to change that number for every operating system. I'm on a Mac running 10.5.8, currently. I installed the serial->USB driver when I installed the arduino software, because I remember that proved crucial last time I had to use a Mac.
Then I uploaded StandardFirmata_2_2_forUNO_0_3 and went through all of the above permutations again just in case, but that didn't seem to make a difference either.
Lights on the arduino blink, and an LED-illuminated switch that it's supposed to power comes on, so it's clear that the arduino is not entirely dead. I'm clearly missing something, eh? Here's one version of my code (there's another program to do the digital input, which is equally non-responsive)... note that this code worked on a Windows machine with a Diecimila board attached to the same sliders etc. when I tried a few weeks ago...
- import processing.serial.*;
- import cc.arduino.*;
- Arduino arduino;
- void setup() {
- size (1024, 600);
- println(Arduino.list());
- arduino = new Arduino(this, Arduino.list()[0], 115200);
- noStroke();
- colorMode(HSB,6);
- frameRate(20);
- }
- void draw() {
- background(0);
- for (int i=0; i<6; i++) {
- stroke (i,6,6);
- noFill();
- rect (i*100, 0, 200, 1024);
- rect (0, i*40, arduino.analogRead(i), 20);
- float total=0;
- fill (i,6,6);
- for (int j=0; j<10; j++){
- total+=arduino.analogRead(i);
- rect (0, i*40+20, total/10, 20);
- }
- }
- }
- /* Without arduino plugged in:
- Native lib Version = RXTX-2.1-7
- Java lib Version = RXTX-2.1-7
- /dev/tty.Bluetooth-Modem
- /dev/cu.Bluetooth-Modem
- /dev/tty.Bluetooth-PDA-Sync
- /dev/cu.Bluetooth-PDA-Sync
- Experimental: JNI_OnLoad called.*/
- /*
- Native lib Version = RXTX-2.1-7
- Java lib Version = RXTX-2.1-7
- /dev/tty.usbmodem621
- /dev/cu.usbmodem621
- /dev/tty.Bluetooth-Modem
- /dev/cu.Bluetooth-Modem
- /dev/tty.Bluetooth-PDA-Sync
- /dev/cu.Bluetooth-PDA-Sync*/
1