Xbee and PWN


I'm running Processing 1.0.1 and Arduino 16. I just got a set of brand new Xbee series 1 transmitters, an Xbee shield and the Sparkfun Xbee explorer. Using the Processing serial library I was able to have a successful blink on click test via the Xbee radio. However, I was trying to modify this first test to send an analog signal to a PWN pin and I cannot seem to get it going. It accepts the first value sent and then wont change. By the way, it works fine over wired USB. Do Xbees not deal well with PWN? Here is my Arduino code:


byte incomingByte;
int val;
void setup() {

  // start serial port at 19200 bps

  // led pins

  pinMode (9, OUTPUT);



void loop() {
  if (Serial.available()) {   // are there any bytes available on the serial port ???
    incomingByte = Serial.read();
    analogWrite(9, incomingByte);
    byte incomingByte == 0;

and here is my Processing code:

import processing.serial.*;
import controlP5.*;

ControlP5 controlP5;
Serial myPort;  // Create object from Serial class
int val;  

int sliderValue = 100;

void setup() {
  String portName = Serial.list()[0];
  myPort = new Serial(this, portName, 19200);

  controlP5 = new ControlP5(this);
  Slider s = controlP5.addSlider("slider",0,255,128,10,10,25,100);

void draw() {
  val  = round(controlP5.controller("slider").value());



Any suggestions. Thanks for helping out a noob. I really super appreciate it. :)