Sign in

username:

password:



Not a member?

Search oopic



Search tips

Subscribe to oopic



Ads

Discussion Groups

Discussion Groups | | lots of buttons

lots of buttons - carr6565 - Aug 27 17:14:40 2008

Hi everyone,

So here is my question how do I use the A2D8 or A2D10 objects to
create lots of buttons(say 6 buttons per A2D line) which I can use to
trigger events, servo position changes and the like? An example of a
specific piece of code would be nice? I know this is possible I just
need a good example for a starting point. Thanks for the help.

Carson
------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )


Re: lots of buttons - carr6565 - Aug 27 21:15:11 2008


Update on this... I have figured out an easier way to do this instead
using the oKeypadX object. I'm still pretty hazy about how to get the
different keys to correspond to specific servo position values so any
similar examples of this object being used to flag different objects
would be really helpful. What I'm trying to do with this isn't that
complex but I am pretty new to this. Essentially I'm trying to make a
30 button array which will control 5 servos, directing them to 6
specific positions. Thanks for the help in advance.
--- In o...@yahoogroups.com, "carr6565" wrote:
>
> Hi everyone,
>
> So here is my question how do I use the A2D8 or A2D10 objects to
> create lots of buttons(say 6 buttons per A2D line) which I can use to
> trigger events, servo position changes and the like? An example of a
> specific piece of code would be nice? I know this is possible I just
> need a good example for a starting point. Thanks for the help.
>
> Carson
>

------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )

Re: lots of buttons - stantibbs1 - Aug 28 9:22:16 2008

If you are set on using the A2D function.
One would first need to build a voltage divider referenced to say, 5V
line.
Maybe use 10, 250 ohm resistors this will result in 10 possible
voltage levels. Hence 10 switches
Add a 10K pull down resistor to the A2D. Connect one term of 10
switches to the same node.
Connect the other side of each switches to the resistors.

Maybe use oA2DX object to detect the voltages generated at the A2D
input as each switch is pressed.
Or maybe use oCompare object it's your choice.
There may well be other possibilities.
Good luck
Stan

--- In o...@yahoogroups.com, "carr6565" wrote:
> Update on this... I have figured out an easier way to do this
instead
> using the oKeypadX object. I'm still pretty hazy about how to get
the
> different keys to correspond to specific servo position values so
any
> similar examples of this object being used to flag different objects
> would be really helpful. What I'm trying to do with this isn't that
> complex but I am pretty new to this. Essentially I'm trying to
make a
> 30 button array which will control 5 servos, directing them to 6
> specific positions. Thanks for the help in advance.
> --- In o...@yahoogroups.com, "carr6565" wrote:
> >
> > Hi everyone,
> >
> > So here is my question how do I use the A2D8 or A2D10 objects to
> > create lots of buttons(say 6 buttons per A2D line) which I can
use to
> > trigger events, servo position changes and the like? An example
of a
> > specific piece of code would be nice? I know this is possible I
just
> > need a good example for a starting point. Thanks for the help.
> >
> > Carson
>
------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )

Re: lots of buttons - stantibbs1 - Aug 29 11:50:15 2008

try this

'
'FILENAME: Keyboard_Control_FOR_1_OF_3_Outputs.osc
'135 bytes

DIM READKEY AS NEW oKEYPAD
Dim LEDG22 As New oDio1
Dim LEDG23 As New oDio1
Dim LEDG24 As New oDio1
Dim LEDG37 As New oDio1
Dim FileName as New oEEProm

Sub Main()
FileName.Data ("Keyboard_Control_FOR_1_OF_3_Outputs.osc")
'Save the FileName to EEProm

LEDG22.IOLine = 18
LEDG23.IOLine = 19
LEDG24.IOLine = 20
LEDG37.IOLine = 31
LEDG22.Direction = cvOutput
LEDG23.Direction = cvOutput
LEDG24.Direction = cvOutput
LEDG37.Direction = cvOutput

LET READKEY.OPERATE = cvTrue
Do
LEDG37.Value = NOT OOPic.Hz1
' READ KEYBOARD
IF READKEY .RECEIVED = 1 THEN
' pins 20 & 12, G1 CONNECTED TO G5
IF READKEY .VALUE = 0 THEN
LEDG22.Value = 1
LEDG23.Value = 0
LEDG24.Value = 0
END IF
' pins 18 & 12, G2 CONNECTED TO G5
IF READKEY .VALUE = 1 THEN
LEDG22.Value = 0
LEDG23.Value = 1
LEDG24.Value = 0
END IF
' pins 16 & 12, G3 CONNECTED TO G5
IF READKEY .VALUE = 2 THEN
LEDG22.Value = 0
LEDG23.Value = 0
LEDG24.Value = 1
END IF
END IF
Loop
End Sub

Stan

--- In o...@yahoogroups.com, "Carson Hoyt" wrote:
>
> Yeah I think making a keypad matrix will be a lot easier. It makes
a lot
> more sense actually, since the A2D route requires a lot more
hardware, which
> would just build up into the same thing.
>
> What would really help is just an example of some code for a keypad
> activating something like leds or maybe, different events. The
sample code
> just really doesn't take me anywhere close to being able to use the
okeypad2
> object. Has anyone written any code using this object to create a
> mechatronic interface?
>
> On Thu, Aug 28, 2008 at 6:22 AM, stantibbs1 wrote:
>
> > If you are set on using the A2D function.
> > One would first need to build a voltage divider referenced to
say, 5V
> > line.
> > Maybe use 10, 250 ohm resistors this will result in 10 possible
> > voltage levels. Hence 10 switches
> > Add a 10K pull down resistor to the A2D. Connect one term of 10
> > switches to the same node.
> > Connect the other side of each switches to the resistors.
> >
> > Maybe use oA2DX object to detect the voltages generated at the A2D
> > input as each switch is pressed.
> > Or maybe use oCompare object it's your choice.
> > There may well be other possibilities.
> > Good luck
> > Stan
> >
> >
> > --- In o...@yahoogroups.com , "carr6565"
> > wrote:
> > >
> > >
> > > Update on this... I have figured out an easier way to do this
> > instead
> > > using the oKeypadX object. I'm still pretty hazy about how to
get
> > the
> > > different keys to correspond to specific servo position values
so
> > any
> > > similar examples of this object being used to flag different
objects
> > > would be really helpful. What I'm trying to do with this isn't
that
> > > complex but I am pretty new to this. Essentially I'm trying to
> > make a
> > > 30 button array which will control 5 servos, directing them to 6
> > > specific positions. Thanks for the help in advance.
> > >
> > >
> > > --- In o...@yahoogroups.com 40yahoogroups.com>, "carr6565"
> > wrote:
> > > >
> > > > Hi everyone,
> > > >
> > > > So here is my question how do I use the A2D8 or A2D10 objects
to
> > > > create lots of buttons(say 6 buttons per A2D line) which I can
> > use to
> > > > trigger events, servo position changes and the like? An
example
> > of a
> > > > specific piece of code would be nice? I know this is possible
I
> > just
> > > > need a good example for a starting point. Thanks for the help.
> > > >
> > > > Carson
> > > >
> > >
> >
> >
> >
> [Non-text portions of this message have been removed]
>

------------------------------------



(You need to be a member of oopic -- send a blank email to oopic-subscribe@yahoogroups.com )