[solved] Components

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times

[solved] Components

Post by dbasnett »

Are there components for the Sensor (EB003) and Relay Board (EB038)?
Last edited by dbasnett on Sun Aug 28, 2011 2:53 pm, edited 1 time in total.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Components

Post by Benj »

Hello,

The sensors can be read using the ADC components and the Relays can be controlled using either an output icon or a LED / LEDbank component.

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times

Re: Components

Post by dbasnett »

If I want to use Port E for the Sensor Board data (without other sensors), am I correct to use ADC channel 5 and 6 (RE0(AN5) and RE1(AN6) respectively)?
Last edited by dbasnett on Sat Aug 27, 2011 7:45 pm, edited 1 time in total.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Components

Post by Benj »

Hello,

It depends on which chip you are using but yes the pins on PortE are usually analogue.

The LDR is bit 0 of the port and the Pot is bit 1 using the default patch setting.

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times

Re: Components

Post by dbasnett »

On the EB003 I have left the default jumper on (J5).

I added two ADC components and left them at the default for Ext Properties.

ADC0 reads the LDR and ADC1 reads the POT. What I am not clear on is what the settings are in Ext Properties, and should I assume they are correct?

The POT seems to work correctly when I read ADC1 as byte. 0 = off ... 255 = full on, and values between those as it is turned. Should I expect anything else?

The LDR seems to return larger byte values when it is darker, and smaller when lighter, though I never receive 0 or 255. How should the LDR value be read?

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Components

Post by medelec35 »

dbasnett wrote: What I am not clear on is what the settings are in Ext Properties, and should I assume they are correct?
It's fine leaving external Properties as they are, unless you want to change pot from rotary type to slider for example. This is just an aesthetic, the characteristics are the same.
dbasnett wrote: The POT seems to work correctly when I read ADC1 as byte. 0 = off ... 255 = full on, and values between those as it is turned. Should I expect anything else?
Nope that about it. turning pot clockwise will reduce value.
dbasnett wrote: The LDR seems to return larger byte values when it is darker, and smaller when lighter, though I never receive 0 or 255. How should the LDR value be read?
That is how it should work. As more light falls on the LDR, its resistance decreases, pulling down the voltage on the port pin (ADC0), hence bytes will reduce.
The less light that falls, then LDR increases its resistance. the resistor that is connected between LDR and +5V pulls the port pin voltage higher so bytes increase.

Martin
Martin

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times

Re: Components

Post by dbasnett »

Is it normal for the LDR never to be 0 or 255? Just curious?

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Components

Post by medelec35 »

dbasnett wrote:Is it normal for the LDR never to be 0 or 255? Just curious?
Oh sorry. Yes its normal for bytes not to go to 0 = 0V or 255 = 5V. So the board is working like it's suppose to.
Reason being, even with loads of light on LDR it will not be a short circuit (if it was s/c then bytes = 0).
And with no light it will not be open circuit, just a higher resistance. (if it was o/c then bytes = 255).

Martin
Martin

Post Reply