Adding feature to my instuctable

Hi Ive just published an instructable here for a RSS connected lamp that is fed data from wavebuoys in the ocean. Basically it helps visualise waveheights by displaying a different colour LED based on the wave height variable on the feed.

What we would really love to do is add a feature that makes the LED pulse when the 'Average Period' hits a certain number

http://www.ndbc.noaa.gov/data/latest_obs/62107.rss

A combination of wave height and high period makes a quality swell in the ocean so a combo of a red light and a pulse would add great functionality in visualising the conditions. Ive posted the present code whilst i continue to research the idea so any pointers would be greatly appreciated.

Many Thanks
Al

If you post your code we may be able to help.

It sounds as if you just need to make your main LED lighting code to cause the LED to flash if some variable (perhaps called wavePeriod) holds a certain value. I would be tempted to make my code such that the LED flashes all the time but when you don't actually want to see the flashes you just make the flash interval very very short. That would also easily allow for different flashing rates.

...R

Ive posted the present code whilst i continue to research the idea

Where did you post the code, its not attached to your post on this forum

My new code is below and something just doesnt seem right...now and again 1/10 it connects but writes the wrong pin the present data of Significant Wave Height: 6.2 ft & Average Period: 6 sec should result in a slighly fading blue LED (pin 6) but it flashes green on pin 5...ive tried as much as i can and am stumped

Thanks

This is the original code http://www.instructables.com/files/orig/F47/RB93/HXZN70FQ/F47RB93HXZN70FQ.ino

#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
char serverName[] = "ndbc.noaa.gov";
EthernetClient client;
boolean time=false;
int long wavetime;
int red=3,green=5,blue=6; // PWM pins initialized to pass values of RGB
float waveheight; // float value that holds wave height
int avgp;
void setup()
{
  Serial.begin(9600);
  pinMode(red   ,OUTPUT);
  pinMode(green ,OUTPUT);
  pinMode(blue  ,OUTPUT);
  if (Ethernet.begin(mac) == 0)
  { // start ethernet using mac & IP address
    while(true) ;
  }
  delay(2000); // give the Ethernet shield 2 second to initialize
}


void loop()
{
  if (client.connect(serverName, 80)>0) {
    client.println("GET http://www.ndbc.noaa.gov/data/latest_obs/62081.rss");
  }
  if (client.connected()) {
    if(client.find("Significant Wave Height:") && client.find("Average Period:"))
    {//look for the wave height and pass the value to variable
      waveheight = client.parseFloat();
      avgp = client.parseInt();
  }
  else{
    digitalWrite(13,HIGH);
  }
  //The code below lights up RGB module light depending on the wave height
   if ((waveheight>=0)&&(waveheight<3))
   {
    
     if (avgp<=10)
     {
       for(int i=0;i<=255;i++)
       {
         analogWrite(red   ,0 );
         analogWrite(green ,i);
         analogWrite(blue  ,0);
         delay(30);
           if(i==255)
             {
               i=0;
             }
             
       }
        if (avgp>=10&&avgp<=15)
     {
       for(int i=0;i<=255;i++)
       {
         analogWrite(red   ,0 );
         analogWrite(green ,i);
         analogWrite(blue  ,0);
         delay(10);
           if(i==255)
             {
               i=0;
             }
              if (avgp>=15)
      { 
      for(int i=0;i<=255;i++)
      {
         analogWrite(red   ,0 );
         analogWrite(green ,i);
         analogWrite(blue  ,0);
         delay(5);
           if(i==255)
             {
               i=0;
             }
       }
   }
   };
   }
   if ((waveheight>=3)&&(waveheight<8))
   {
     
         
    
     if (avgp<=10)
     {
       for(int i=0;i<=255;i++)
       {
         analogWrite(red   ,0 );
         analogWrite(green ,0);
         analogWrite(blue  ,i);
         delay(5);
           if(i==255)
             {
               i=0;
             }
             
       }
        if (avgp>=10&&avgp<=15)
     {
       for(int i=0;i<=255;i++)
       {
         analogWrite(red   ,0 );
         analogWrite(green ,0);
         analogWrite(blue  ,i);
         delay(10);
           if(i==255)
             {
               i=0;
             }
              if (avgp>=15)
      { 
      for(int i=0;i<=255;i++)
      {
         analogWrite(red   ,0 );
         analogWrite(green ,0);
         analogWrite(blue  ,i);
         delay(20);
           if(i==255)
             {
               i=0;
             }
       }
   }
   };
   if ((waveheight>=8)&&(waveheight<100))
   {
     
     if (avgp<=10)
     {
       for(int i=0;i<=255;i++)
       {
         analogWrite(red   ,i );
         analogWrite(green ,0);
         analogWrite(blue  ,0);
         delay(20);
           if(i==255)
             {
               i=0;
             }
             
       }
        if (avgp>=10&&avgp<=15)
     {
       for(int i=0;i<=255;i++)
       {
         analogWrite(red   ,i );
         analogWrite(green ,0);
         analogWrite(blue  ,0);
         delay(10);
           if(i==255)
             {
               i=0;
             }
              if (avgp>=15)
     {
       for(int i=0;i<=255;i++)
       {
         analogWrite(red   ,i );
         analogWrite(green ,0);
         analogWrite(blue  ,0);
         delay(5);
           if(i==255)
             {
               i=0;
             }
       }
   }
  client.stop();//Disconnect
}
}
}
   }
     }
     }
   }
     }
   }
  }
}