unable to return a value from gui
- From: "vin j" <micro_vin@xxxxxxxxxxx>
- Date: Sat, 30 Aug 2008 13:16:01 +0000 (UTC)
i'm new to matlab . My objective is to run my servo and
motor when i click one of the radiobutton but unable to do
so... hope you can help thanks...
Another file contain motor and servo value
motor source code
=================
% speed1 = 80; % Right Motor Speed
% speed2 = 80; % Left Motor Speed
servo source code
=================
servo = servo + 8;
if (servo > 255)
servo = 1;
end
GUI source code % return the values when i click the radio
button
==============
function sergui(hObject,eventdata)
figure
('MenuBar','none','Name','Figure4','NumberTitle','off','Position'[200,200,420,160]);
v = uibuttongroup ('Position',[.05,.05,.9,.9]);
switch get(eventdata.NewValue,'parent') % Get Tag
uicontrol('Style','radioButton1','String','0DEGREE','Position',
[30,110,90,20],'Parent',v);
case 'radiobutton1' servo = 122;
uicontrol('Style','radioButton2','String','90DEGREE','Position',[30,70,90,20],'Parent',v);
case 'radiobutton2' servo = 220; speed1=110;
uicontrol('Style','radioButton3','String','180DEGREE','Position',[30,30,90,20],'Parent',v);
case 'radiobutton3' servo = 240; speed2 = 220;
.
otherwise
servo = 255;
end
.
- Prev by Date: Re: Beginner - Help on Nelder Mead Method
- Next by Date: Re: Deleting ALL rows of [1,1,1]
- Previous by thread: convertion of image
- Next by thread: Re: the "GOTO" statement
- Index(es):