Skip to content
This repository has been archived by the owner on Apr 5, 2020. It is now read-only.

continous drive #13

Open
nowark opened this issue Jan 16, 2016 · 0 comments
Open

continous drive #13

nowark opened this issue Jan 16, 2016 · 0 comments

Comments

@nowark
Copy link

nowark commented Jan 16, 2016

Hello,
First of all, great job creating this API. I am new to programming so please be patient if i ask wrong question.

  1. I had sed this api for 2 monh already and stopped yesterday. The problem is a don't know how to write a command to drive continuously. I mean that i know how to write a command to drive forward or backward for time and with power. But is there a way that iam mising to write a method that command to drive some time forward then turn left and then go forward for some time. I fought that if i create a button and add a code for example"

private void Button1Clicked(object sender, RoutedEventArgs routedEventArgs)
{
await brick.DirectCommand.TurnMotorAtPowerAsync(OutputPort.A | OutputPort.B, 50, 5000);
await brick.DirectCommand.TurnMotorAtPowerAsync(OutputPort.A, 50, 5000);
await brick.DirectCommand.TurnMotorAtPowerAsync(OutputPort.A | OutputPort.B, 50, 5000);
}
The brick only see a one command and dont do all of them.

  1. i wrote sth like this:

private void Button2Clicked(object sender, RoutedEventArgs routedEventArgs)
{
if(TextBox1.Text == "1")
GoForward(); // method for going forward for some time
else if(TextBox1.Text == "2")
GoBackward();
}

it worked when i used textbox and write something on it.
But how to use a data from sensor so it can behave deiferently. I tried to figure out how to do it from other language but i dont have knowlege to do so.

I will be very greatefull if anyone can help me with this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant