Basic 2 channel PWM setup
Posted: Sat Apr 28, 2012 10:47 pm
I apologize for posting this noob question in advance, but I simply cannot find an understandable explanation anywhere. I want to set up PWM dimming for my DIY LEDs. I have 2 PWM dimmable meanwell drivers, one for blues and one fore whites. All I want is an explanation of how to set up PWM dimming so that I have sunrise/sunset effects. It seems so easy with RAGEN, but I get errors and don't know how to fix them. Here's what I have from RAGEN:
Its pretty intuitive that I put the On hours and minutes in each of their respective places, and after looking at the PWMSlope example file I understand what arguments go in the other places as well (I assume that nothing goes in the GetDaylightVlaue() argument). But when I try to compile this I get all kinds of crazy errors saying that none of my files or directories exist, despite the fact that the libraries folder is exactly where the error message says it is and the files are in that directory... What happened and what should I do to fix this?
Code: Select all
// Autogenerated file by RAGen (v1.2.1.158), (04/28/2012 21:03)
// RA_042812_2103.pde
//
// This version designed for v0.8.5 Beta 17 or later
/* The following features are enabled for this File:
#define DisplayImages
#define DateTimeSetup
#define VersionMenu
#define DirectTempSensor
#define DisplayLEDPWM
#define SaveRelayState
#define SIMPLE_MENU
*/
#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>
void setup()
{
ReefAngel.Init(); //Initialize controller
// Ports that are always on
ReefAngel.Relay.On(Port5);
}
void loop()
{
// Specific functions
ReefAngel.StandardLights(Port1);
ReefAngel.StandardLights(Port2);
ReefAngel.StandardLights(Port3);
ReefAngel.StandardLights(Port4);
ReefAngel.StandardHeater(Port6);
ReefAngel.DosingPump1(Port7);
ReefAngel.DosingPump2(Port8);
ReefAngel.PWM.SetActinic(PWMSlope(
InternalMemory.StdLightsOnHour_read(),
InternalMemory.StdLightsOnMinute_read(),
InternalMemory.StdLightsOffHour_read(),
InternalMemory.StdLightsOffMinute_read(),
InternalMemory.PWMSlopeStartA_read(),
InternalMemory.PWMSlopeEndA_read(),
InternalMemory.PWMSlopeDurationA_read(),
ReefAngel.PWM.GetActinicValue()
));
ReefAngel.PWM.SetDaylight(PWMSlope(
InternalMemory.StdLightsOnHour_read(),
InternalMemory.StdLightsOnMinute_read(),
InternalMemory.StdLightsOffHour_read(),
InternalMemory.StdLightsOffMinute_read(),
InternalMemory.PWMSlopeStartD_read(),
InternalMemory.PWMSlopeEndD_read(),
InternalMemory.PWMSlopeDurationD_read(),
ReefAngel.PWM.GetDaylightValue()
));
ReefAngel.ShowInterface();
}