Coding Pwm module.
Re: Coding Pwm module.
I may have screwed up the numbers. They should've represented the time for cloud (C) and ligthtning(L)
Roberto.
Re: Coding Pwm module.
now my moonlight which was fixed on actinic is hanging. on portal it is showing 0% but my moonlight is shining brightly.
Re: Coding Pwm module.
// Autogenerated file by RAGen (v1.2.2.171), (05/04/2012 21:21)
// RA_050412_2121.ino
//
// This version designed for v0.9.0 or later
/* The following features are enabled for this File:
#define VersionMenu
#define DisplayLEDPWM
#define wifi
#define WDT
#define SIMPLE_MENU
#define PWMEXPANSION
*/
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <ReefAngel.h>
////// Place global variable code below here
////// Place global variable code above here
byte SeasonsVar[]={
0,0,0,0,0,0};
int LastNumMins=0;
void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
// Ports that are always on
ReefAngel.Relay.On(Port4);
ReefAngel.Relay.On(Port7);
ReefAngel.Relay.On(Port3);
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
// Specific functions that use Internal Memory values
ReefAngel.SingleATOLow(Port1);
ReefAngel.StandardLights(Port2);
ReefAngel.WavemakerToggle(Port5, Port6, 60);
ReefAngel.StandardHeater(Port8);
// PWMSlope based on Internal Memory values for Standard Lights
if (ReefAngel.Relay.Status(Port2)) ReefAngel.PWM.SetActinic(0); else ReefAngel.PWM.SetActinic(MoonPhase());
////// Place your custom code below here
ReefAngel.PWM.SetChannel(0,PWMParabola(9,0,20,0,0,100,0));
ReefAngel.PWM.SetChannel(1,PWMParabola(9,0,20,0,0,100,0));
ReefAngel.PWM.SetChannel(2,PWMParabola(9,0,20,0,0,100,0));
ReefAngel.PWM.SetChannel(3,PWMParabola(9,0,20,0,0,100,0));
byte Fan1Speed;
Fan1Speed=map(ReefAngel.Params.Temp[1],722,950,30,100); // Calculate Fan 1 speed
Fan1Speed=constrain(Fan1Speed,0,100);
ReefAngel.PWM.SetChannel(4,Fan1Speed);
byte Fan2Speed;
Fan2Speed=map(ReefAngel.Params.Temp[2],722,950,30,100); // Calculate Fan 2 speed
Fan2Speed=constrain(Fan2Speed,0,100);
ReefAngel.PWM.SetChannel(5,Fan2Speed);
Wire.requestFrom(8,6);
for (int a=0;a<6;a++)
{
if (Wire.available()) SeasonsVar[a]=Wire.read();
}
if (LastNumMins!=NumMins(hour(),minute()))
{
LastNumMins=NumMins(hour(),minute());
ReefAngel.LCD.Clear(255,0,120,132,132);
ReefAngel.LCD.DrawText(0,255,5,120,"C");
ReefAngel.LCD.DrawText(0,255,11,120,"00:00");
ReefAngel.LCD.DrawText(0,255,45,120,"L");
ReefAngel.LCD.DrawText(0,255,51,120,"00:00");
if (SeasonsVar[4])
{
int x=0;
if (SeasonsVar[0]>=10) x=11; else x=17;
ReefAngel.LCD.DrawText(0,255,x,120,SeasonsVar[0]);
if (SeasonsVar[1]>=10) x=29; else x=35;
ReefAngel.LCD.DrawText(0,255,x,120,SeasonsVar[1]);
}
if (SeasonsVar[5])
{
int x=0;
if (SeasonsVar[3]>=10) x=51; else x=57;
ReefAngel.LCD.DrawText(0,255,x,120,SeasonsVar[3]);
if (SeasonsVar[4]>=10) x=69; else x=75;
ReefAngel.LCD.DrawText(0,255,x,120,SeasonsVar[4]);
}
}
////// Place your custom code above here
// This sends all the data to the portal
// Do not add any custom code that changes any relay status after this line
// The only code after this line should be the ShowInterface function
ReefAngel.Portal("abhi_123","");
// This should always be the last line
ReefAngel.ShowInterface();
}
Re: Coding Pwm module.
What happens if you reboot the controller?
Did it start after you added the last code?
Did it start after you added the last code?
Roberto.
Re: Coding Pwm module.
the light is running continously even after unplugging the power cable when i again put the power its start.
Re: Coding Pwm module.
I think I created a bug on the previous libraries release.
Can you use the update utility and upload your code again?
Can you use the update utility and upload your code again?
Roberto.
Re: Coding Pwm module.
The code is working fine for now. I want to add sunrise sunset effect as per season variance. So longer days during summer & shorter during winter.
Re: Coding Pwm module.
Roberto.
Re: Coding Pwm module.
That ok but the prob is that i am not overridding the current. i am using aquastyle led which are connected in 2 parallel strings of 12 led each. the maximum forward voltage is 3.6 for each making 43.2 for a string whereas the voltage range for the driver is 28.8 to 48v.
here is the link for the specification of driver i am using.http://www.meanwell.com/search/LPF-60D/default.htm
here is the link for the specification of driver i am using.http://www.meanwell.com/search/LPF-60D/default.htm
Re: Coding Pwm module.
So, it was working before with another driver, but it doesn't on this one?
Has it ever worked on this driver?
Did you test the driver?
Has it ever worked on this driver?
Did you test the driver?
Roberto.
Re: Coding Pwm module.
Well i am just going to buy one 10VDC Adaptor to look whether it works with that or not. i think with 10 V they will lit up at 100%
Re: Coding Pwm module.
Update.
Output voltage of my driver is 49.5v & output for the dimming cable is 10v. my pwm channel output is also as per value shown on portal. dont know where i am messing up
Output voltage of my driver is 49.5v & output for the dimming cable is 10v. my pwm channel output is also as per value shown on portal. dont know where i am messing up

Re: Coding Pwm module.
Does it stop flashing if you disconnect the drivers from RA?
What happens when you use a AA battery or a 9V battery instead of RA?
What happens when you use a AA battery or a 9V battery instead of RA?
Roberto.
Re: Coding Pwm module.
when i am using AA battery for single led it is running fine. havnt checked the leds without RA.
Re: Coding Pwm module.
What I meant was use the AA battery as dimming signal for the drivers.
Roberto.
Re: Coding Pwm module.
got it. Will be using 9 volt battery & update here.
Last edited by abhi_123 on Mon Jun 04, 2012 11:45 pm, edited 1 time in total.
Re: Coding Pwm module.
1.5V should give you 15%.
On LPF driver, it should be above the threshold.
I head they go all the way down to 3%
On LPF driver, it should be above the threshold.
I head they go all the way down to 3%
Roberto.
Re: Coding Pwm module.
dimming is ok. the prob is with the voltage or current coz of that they are blinking. any idea how to correct it?