Forum Replies Created
-
AuthorPosts
-
Anders SøborgKeymasterHave you enabled streaming on the phone?
Anders
- This reply was modified 10 years, 11 months ago by Anders Søborg.
- This reply was modified 10 years, 11 months ago by Anders Søborg.
- This reply was modified 10 years, 11 months ago by Anders Søborg.
Anders SøborgKeymasterGreat thanks for the update – I did the guide on OS X 10.8 Mountain Lion. So thrilled that you are thrilled 🙂
Anders SøborgKeymasterHi – thanks for using MonoBrick Communication library
Start off by downloading the Monobrick Communication Library for Android. The first thing you need to do is to check if Bluetooth is turned on. This can be done by using the static property on the Bluetooth class as shown below.
MonoBrick.Bluetooth<BrickCommand,BrickReply>.IsEnabled
If Bluetooth is not turned on use the following code to turn it on
MonoBrick.Bluetooth<BrickCommand,BrickReply>.Enable();
Once Bluetooth has been turned on use the following code to get a list of paired devices
MonoBrick.Bluetooth.BondDevices
If you know the device name you can also call
MonoBrick.Bluetooth.GetBondDevice(string deviceName);
Use the Bluetooth device to create a Bluetooth connection instance and create a brick class followed by opening the connection. The code below sums it all up.
var device = MonoBrick.Bluetooth<MonoBrick.EV3.Command, MonoBrick.EV3.Reply>.GetBondDevice("youDeviceName"); var connection = new Bluetooth<MonoBrick.EV3.Command, MonoBrick.EV3.Reply>(device); var brick = new MonoBrick.EV3.Brick<MonoBrick.EV3.Sensor,MonoBrick.EV3.Sensor,MonoBrick.EV3.Sensor,MonoBrick.EV3.Sensor>(connection); brick.Connection.Open();
Replace EV3 namespace with NXT namespace depending on your device
Let me know how it goes
Anders
- This reply was modified 10 years, 11 months ago by Anders Søborg.
December 17, 2013 at 12:37 in reply to: Unable to Connect with the MonoBrick Remote for Android #3315
Anders SøborgKeymasterHi
And Sorry for the late reply. What brick are you using NXT or EV3. The remote only works with the NXT…
Anders
Anders SøborgKeymasterHi Bo
It seems you are able to (through the remote api) send commands directly to the sensors/motors and bypassing the brick CPU itself? Or I am mistaken?
When you send commands to EV3 the standard firwmare interpret the command and communicated with a set of low level “kernel” modules that controls the hardware (LCD, motor, sensors etc.). The firmware also takes care of sending the appropriate reply. When sending a command it is possible to “bypass” the running program. Say that your program has told the motor to run forward at speed 50 it is in fact possible afterwards to send a command to stop the motor without the running program knowing about it. This might give unexpected behaviour if you don’t know what you are doing.
Second question would be that do you have access to a Lego command specification, or you have reverse engineered all of that?
A LEGO command specification does not exist – but the source code for the EV3 firmware has some nice comments that will get you a long way. The source code is open source and can be downloaded at Github.
I hope this answers all your questions…
Anders
- This reply was modified 10 years, 11 months ago by Anders Søborg.
Anders SøborgKeymasterHi
The error that you are getting implies that you failed to load the hidapi.dll. The hidapi.dll in the MonoBrick download comes from my LEGO Software installation folder. I have tested this on two different Windows machines running Windows 7 64-bit and 32-bit and it worked in both Visual Studio and MonoDevelop. Try to compile your own hidapi.dll or maybe copy the dll file that comes with your LEGO EV3 installation. Just to make things clear the MonoBrick Remote does not support the EV3 yet.
Anders
- This reply was modified 10 years, 11 months ago by Anders Søborg.
-
AuthorPosts
Follow