[solved] Components
Moderator: Benj
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Components
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.
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Components
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?
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
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: What I am not clear on is what the settings are in Ext Properties, and should I assume they are correct?
Nope that about it. turning pot clockwise will reduce value.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?
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.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?
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
-
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
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.dbasnett wrote:Is it normal for the LDR never to be 0 or 255? Just curious?
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