Basic Question

Share you PDE file with our community
Post Reply
grafspee1217
Posts: 84
Joined: Sun Mar 11, 2012 10:38 am

Basic Question

Post by grafspee1217 »

Hi everyone,
I recently received my Reef Angel controller and have been working on getting it set up. I have managed to load the internal memory file, set up the wifi, and load a basic PDE with RAGen. I wanted to start working on the PWM slope for my LED lights. I have found the post by Curt that gives the code for the PWM slope and I understand how to enter the times etc. Here is my understanding of how this works, PWM slope is not yet incorporated into RAGen so it has to be added manually. I generate a PDE file with RAGen. It then launches Arduino where I copy and paste the code for PWM slope into the sketch. I upload it to the controller and all should be well.

Here is my question, lets say I want to do something that is not in RAGen, some new ATO function for example. I would need someone to help me write the code. Once I have that do I have to start all over again? Meaning generate a PDE with RAGen, add the PWM slope again and add then add the new ATO code? I imagine that you can only upload to the controller and not download the PDE from it.

Another question, if I create a basic PDE with RAGen then add the PWM code, can I save that PDE in my documents folder before I upload it? This would allow me to change it in the future without having to recreate everything every time I wanted to make a change.
Thanks for the help
Sebyte

Re: Basic Question

Post by Sebyte »

First things first, are you using the latest library? The reason for asking is that you mention the PDE files, which have now been replaced by INO files. Take a look at http://forum.reefangel.com/viewtopic.php?f=2&t=580 if you have not already done so.

Also look at http://forum.reefangel.com/viewtopic.php?f=8&t=2 for a tool to check that you are up to date.
Here is my question, lets say I want to do something that is not in RAGen, some new ATO function for example. I would need someone to help me write the code. Once I have that do I have to start all over again? Meaning generate a PDE with RAGen, add the PWM slope again and add then add the new ATO code? I imagine that you can only upload to the controller and not download the PDE from it.
If you cannot write your own code, and you will find almost every routine that you will need has already been posted somewhere on the forum (may take a bit of searching ;) ) just post your question and you will get help with sorting things out.

You are correct you cannot download a PDE/INO file from the controller.
if I create a basic PDE with RAGen then add the PWM code, can I save that PDE in my documents folder before I upload it? This would allow me to change it in the future without having to recreate everything every time I wanted to make a change.
That is exactly what you do. If you look in the C:\Users\YOUR USER NAME\Documents\Arduino folder you will find all the PDE/INO files created when you have run RAgen. You can open them in the Arduino complier application, edit and save them with a different name. I use a version number each time I change a INO file. That way I can go back to earlier builds if needed.

All code is reusable. Have fun :D
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Basic Question

Post by binder »

RAGen does add the PWMSlope code to your controller for you. I forget what version I added it in but it is currently in there. It utilizes the values from Internal Memory, so those must be set and it is only for the Actinic and Daylight channels. If you wanted to "hard code" the times, you can do that by using my PWM post.

By default, ALL PDE/INO files are saved in ~/Documents/Arduino/ folder using the current date & time stamp as the name. RA_MMDDYY_HHMM.ino (or .pde) and they are in their own folders with the same RA_MMDDYY_HHMM stamp.

A lot of times, you just need to use RAGen once to generate your master code file OR generate a bunch of code files to use as examples to get a better understanding for the code. Once you do that, you just keep modifying the existing code file manually OR you start over with a new code file from RAGen.

If you want to add more code to your PDE/INO file, you just need to either remember which PDE/INO file you have uploaded or inside Arduino do a File->Save As and give it a name like "My Tank" or whatever. Then you know that is the code file you upload. Then you can just open it up and edit that file and reupload it if you want to load the latest libraries or add a new feature to your controller.

Like Steve said, a LOT of the code or functionality you may want has already been written. If not, you can attempt to do it yourself or post on here for help. Somebody will either write it for you or help you get it written and tell you how to do it.
Post Reply