Hello,
First of all, great job creating this API. I am new to programming so please be patient if i ask wrong question.
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.
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.
Hello, First of all, great job creating this API. I am new to programming so please be patient if i ask wrong question.
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.
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.