Arduino Micro not working with Processing

Hello, I just got a new Arduino Micro. I have previously been using an Uno and had StandardFirmata uploaded to the board. Using processing.serial.* and the Arduino library for Processing I was doing analogRead and whatnot and everything was working fine.
I just switched the hardware out for the Arduino Micro and the Processing sketch no longer works. Running Arduino code (from the IDE) everything works fine, but it seems on the Processing side it does not work with the Arduino Micro.
Anyone have ideas for how I can get this to work? I have tried searching, but the Micro seems fairly new and not much info is out there on it, especially with Firmata and Processing.

Thanks,
Adam

aml25:
the Processing sketch no longer works.

What does "no longer works" mean?

The Micro is the same as the Leonardo, which isn't as new.

The analogRead's just show up as '0' . But, if I run an analog read/serial out sketch from Arduino without changing anything else, it works fine (gets the sensor values).

Is the processing code selecting the right serial port?

Seems like it.
If I do:
println(Arduino.list());
In Processing then only 1 index shows up.
If I switch the cables and plug in my Uno, the Processing sketch works fine.

I did just find this on the Rhino/Grasshopper forum (3d modelling and parametric modelling softwar that can interface with Arduino):
"Any chance to add Arduino Leonardo support? I know the serial changed on this board. Now the USB serial is not the same as the TTL, meaning that we would need a serial to usb adapter (FTDI cable?) to get this over the serial port. I guess one could also tap into the CDC driver. Is this something you have considered?"

Could this be something that would be causing the Leonardo (or Micro in my case) to not be working with Processing/Firmata? Assuming I am not doing something stupid. I feel like my troubleshooting abilities are causing me to believe there is an actual issue here rather than something I am doing. I could be wrong obviously.

Thanks.

No USB-serial goes to pins 0 and 1 on the Leonardo / Micro. So external hardware trying to talk to the PC can't do it over pins 0 and 1.

On the Leonardo / Micro "Serial" is for USB communication and "Serial1" is for the hardware UART connected to pins 0 and 1.

The post you found probably doesn't apply. Without see any code, it is hard to say.

Thanks for the help James. Here is the code. The Arduino code is just the "StandardFirmata" exapmle and the Processing sketch to just plot the sensor over time.
I am just very confused as to why it works fine with the Uno but when I plug the Micro in (unplugging the Uno) it doesn't work (after uploading the StandardFirmata code).

import cc.arduino.*;
import processing.serial.*;

ArrayList<Float> vals = new ArrayList<Float>();
Arduino a;
long currMillis = 0;
long prevMillis = 0;
int interval = 500;
int avgInterval = 5;
long avgIntervalPrevMillis = 0;
float avgCountTotal = 0;
int numValsIntoAvg = 0;



void setup(){
  size(800,600);
  smooth();
  println(Arduino.list());
  a = new Arduino(this, Arduino.list()[0],57600);
}

void draw(){
  background(0);
  currMillis = millis();
  
  if(currMillis - avgIntervalPrevMillis > avgInterval){
    avgIntervalPrevMillis = currMillis;
    avgCountTotal += a.analogRead(0);
    numValsIntoAvg++;
  }
  
  if(currMillis - prevMillis > interval){
    prevMillis = currMillis;
    if(vals.size() > 60){
      vals.remove(0);  
    }
    vals.add(avgCountTotal/(numValsIntoAvg));
    avgCountTotal = 0;
    numValsIntoAvg = 0;
  }
  
  fill(255);
  noStroke();
  textSize(48);
  textAlign(LEFT);
  text(vals.get(vals.size()-1),2,50);
  
  
  noFill();
  stroke(255);
  strokeCap(ROUND);
  strokeWeight(5);
  beginShape();
  for(int i=0;i<vals.size();i++){
    float x = map(i,0,vals.size()-1,0,width);
    float y = map(vals.get(i),50,900,height,0);
    if(y > height){
      y = height;  
    }
    if(y < 0){
      y = 0;  
    }
    vertex(x,y);
  }
  endShape();
}

That is Processing code. Perhaps post it on the Processing forum? Thanks.

I haven't looked at the Firmata stuff for a while, but you need to understand that it is not actively supported. That it does not work for newer boards is hardly a surprise. I think it's time for you to develop and implement your own protocol and quit relying on an unsupported product to meet your needs.

aml25:
I am just very confused as to why it works fine with the Uno but when I plug the Micro in (unplugging the Uno) it doesn't work (after uploading the StandardFirmata code).

I don't know what's going on inside the USB driver, but my Arduinos don't always come up on the same COM port. I haven't proved this conclusively, but it seems to me that each physical Arduino associates itself with the same COM port. For example, if I have a UNO plugged in, it may appear as COM5. If I disconnect it and plug in a different UNO which looks identical in every way and has the same sketch on it, it will come up as COM6. If I disconnect it and plug the original UNO back in, it will appear as COM5.

If your system does something similar then I think it's quite likely that the COM port which is correct for the UNO is wrong for the Micro. You could verify the actual COM port used by each board using the Arduino IDE.

I posted this here because the gentleman helping me previously said "it is hard to say without seeing code." Since the Arduino side was just StandardFirmata, I assumed I didn't need to post that. Thanks.

PeterH:
If your system does something similar then I think it's quite likely that the COM port which is correct for the UNO is wrong for the Micro. You could verify the actual COM port used by each board using the Arduino IDE.

Yes this was something I have been paying attention to. They are different COM ports, but they remain the first index in the Arduino.list() array so they correct port is always being selected in both cases.