Page 1 of 1

Ebb & Flow

Posted: Wed Aug 21, 2013 2:49 pm
by Justin@yahoo
This is an Ebb&Flow system, a small part of a larger system for an aquaponics system.
This is my first FC Project.

The system uses 3 inputs;
A light sensor & 2 float switches
And 2 outputs;
A Pump & a Solenoid release valve

I wish to accomplish the following; Water is pumped into the system if its day time, water continuosly pumps until Float Switch T is in the on position, the system is drained until Float Switch B is in the on position, the system waits 1 hr before repeating this task, when it becomes dark we check if Float Switch T is in the on position. The system drains until Float Switch B is in the on position, the system then goes to sleep & is interrupted by the rise of the sun to begin its operations again.
ebbnflow.fcf_avr - Main.JPG
(210.31 KiB) Downloaded 2398 times
Because i have no way of properly simulating an ADC input with FC_AVR (lightsensor), i am unsure if i am properly implementing the interrupt or sleep(); command.

Any Thoughts?

Re: Ebb & Flow

Posted: Wed Aug 21, 2013 4:06 pm
by dazz
Hi Justin
First of welcome, can you attach your flowchart to a post please as it will enable someone trying to help to see what avr device you are using
heres a quick tip to answer your question in the other thread open a new flowchart add an adc component to the panel, right clich component/select connections/ and set it to ano, now if you enable chip view then press the sim start and the pin will light up on the chip view showing the ain0 pin,
REgards
DAzz

Re: Ebb & Flow

Posted: Wed Aug 21, 2013 4:52 pm
by dazz
Hi
Im adding a flowchart with some basics on to get you started,theres a decition branch and some macros to show basic differences etc
hope it helps (not sure which Avr you are using but if its different on the free one select the one you have)
Leds added for demo purpose could be anyhing you want on the output
Regards
Dazz
Avr ideas demo.fcf_avr
(20.07 KiB) Downloaded 377 times

Re: Ebb & Flow

Posted: Wed Aug 21, 2013 11:20 pm
by Justin@yahoo
Uninstalling/Installing the trial, as the demo you provided doesn't work, "crossing fingers" :roll:

Re: Ebb & Flow

Posted: Wed Aug 21, 2013 11:39 pm
by Justin@yahoo
Seems the installation was screwy , the demo works, but...

When i open the file, it states only 16 icons can be used, whereas before it allowed more than it should have, but some features were crippled :(

So i have deleted & started again.

Re: Ebb & Flow

Posted: Thu Aug 22, 2013 12:09 am
by Justin@yahoo
ebbnflow.fcf_avr
(9.55 KiB) Downloaded 414 times
Stuck on how to attach an interrupt on ADC3, call sleep(); function on change.
Wake up from power-down.
What i need to put into the code box to power-down / wake-up on pin change of adc3 ?

Cheers!

Re: Ebb & Flow

Posted: Thu Aug 22, 2013 12:08 pm
by dazz
Hi Justin
See if this one loads same as the first just changed the chip to the one your using

Regards
Dazz

Re: Ebb & Flow

Posted: Thu Aug 22, 2013 2:29 pm
by Justin@yahoo
As stated 3 replies back, it is working dazz, but thanks though for being more enthusiastic in finding another answer :lol: than actually reading the posts :wink:

Really need help with using interrupts on "Pin Change Interrupts" , how they are implemented, how to include external libraries i.e. sleep.h
I already understand the process from within the Arduino IDE, but unsure how to implement in flowcode?

Re: Ebb & Flow

Posted: Thu Aug 22, 2013 4:07 pm
by dazz
Hi Justin
That'll teach me to get up and log into the forum before i had 3 coffees and 6 or 7 ciggy's :lol: :lol:
check the attached flowchart as ive added sleep functions, it compiles etc read the first comment on flowchart as it shows how to add interrupt for sleep

Regards
DAzz
Avr ideas demo with sleep.fcf_avr
(23.52 KiB) Downloaded 389 times

Re: Ebb & Flow

Posted: Tue Aug 27, 2013 8:41 am
by Justin@yahoo
I applied the v5 update, now my demo says in the panel "This copy of Flowcode belongs to: Dazz-Wendy"
err umm

I got down and dirty with the Arduino ide this week or so & ported this idea to work with ATtiny85, i can & understand port/pin register manipulations only from reading and understanding the C export from Flowcode, so therefore many thanks for all your effort.

I was primarily using FFC to learn from, as the final code was the smallest & fastest. Which in turn is closer to asm for 1:1 clock cycles.

I will continue to use FC & will probably @ some point buy it, that is a definite. Just for the sheer fact, it is faster to prototype in FC than directly writing most of the code.

I have designed & built 3 circuits based on the ATtiny85, if not for FC, i would still be working on the first.

I am awaiting parts to finally finish my hot-water collector, my solar tracker & Aquaponics system.

Many thanks for your diligence & hard work :)

Re: Ebb & Flow

Posted: Tue Aug 27, 2013 9:02 am
by dazz
Hi Justin
If you open a flowchart someone else modified and saved it will have thier name on the demo panel

Regards
Dazz

Re: Ebb & Flow

Posted: Tue Aug 27, 2013 11:31 am
by Justin@yahoo
lol