Tcm0

Forum Replies Created

Viewing 15 posts - 46 through 60 (of 107 total)
  • Author
    Posts
  • Author Image
    Tcm0
    Participant

    Are you sure that you want to use F# and not C#?

    in reply to: MonoBrick Tutorial [German] #5052
    Author Image
    Tcm0
    Participant

    Thank you.

    It’s not really possible to detect the color “orange” with the sensor. You can still use the reflected light mode.
    Theoretically you could use the “RGB Mode” of the EV3s color sensor but that is not supported by MonoBrick.

    in reply to: MonoBrick Tutorial [German] #5045
    Author Image
    Tcm0
    Participant

    Great 🙂
    Could you please give me tips on how to make the tutorial better?

    in reply to: Webserver #5041
    Author Image
    Tcm0
    Participant

    “I have tried leJOS and it is hosted in the ev3 brick which can be controlled by any device that is connected in the same network (is thr any solution for different network?).”
    You can open the port to access the website (probably 8080 redirect to 80). Then everything can access to the server from the internet. But you have to get the online IP somehow.

    “Is there any way like hosting an ASP.net online website somewhere outside rather then on the EV3, so i can still able to control ev3 during my oversea trip.”
    You can run a webserver on a computer which can access the EV3 through the MonoBrick communication library.

    in reply to: Recieve data via Bluetooth #5039
    Author Image
    Tcm0
    Participant

    I think that it’s theoretically possible to open a hotspot on your phone. But I don’t know how good that works.

    in reply to: Recieve data via Bluetooth #5037
    Author Image
    Tcm0
    Participant

    MonoBrick doesn’t support bluetooth yet.
    You can try to use Wifi instead of bluetooth.

    in reply to: MonoBrick Tutorial [German] #5034
    Author Image
    Tcm0
    Participant

    Yes, the template is working and mentioned in the tutorial. But it’s not very comfortable because you can’t return to the main menu when you started an app.

    in reply to: Using the NXT Color Sensor with EV3 #5030
    Author Image
    Tcm0
    Participant

    Tho you can still read it with “ReadRaw ()” and “Read ()”. It just won’t return colors but light intensity in percent.

    in reply to: How to use AbsoluteIMU-ACG sensor? #4954
    Author Image
    Tcm0
    Participant

    “Try to read 8 bytes instead of four. I found that some sensors only supports read 8 bytes at a time. If this does not work try to read a single byte.” (Anders Søborg)

    in reply to: How to use AbsoluteIMU-ACG sensor? #4945
    Author Image
    Tcm0
    Participant

    Could you please try the following code?

    using System;
    using MonoBrickFirmware.Sensors;
    
    namespace MonoBrickHelloWorld
    {
    	public class MindsensorsAbsoluteIMU : I2CSensor
    	{
    		public MindsensorsAbsoluteIMU (SensorPort Port) : base (Port, (byte)0x22, I2CMode.LowSpeed)
    		{
    			base.Initialise ();
    		}
    
    		public void ChangeAccelerometerSensitivity (string Sensitivity)
    		{
    			byte[] BytesToWrite = {(byte)0};
    			if (Sensitivity == "2G" || Sensitivity == "2g") BytesToWrite[0] = (byte) 0x31;
    			else if (Sensitivity == "4G" || Sensitivity == "4g") BytesToWrite[0] = (byte) 0x32;
    			else if (Sensitivity == "8G" || Sensitivity == "8g") BytesToWrite[0] = (byte) 0x33;
    			else if (Sensitivity == "16G" || Sensitivity == "16g") BytesToWrite[0] = (byte) 0x34;
    			else throw new ArgumentException();
    			base.WriteRegister((byte)0x22, BytesToWrite);
    			return;
    		}
    
    		public byte[] ReadX ()
    		{
    			return(base.ReadRegister ((byte)0x42, 8));
    		}
    
    		public byte[] ReadY ()
    		{
    			return(base.ReadRegister ((byte)0x43, 8));
    		}
    
    		public byte[] ReadZ ()
    		{
    			return(base.ReadRegister ((byte)0x44, 8));
    		}
    
    		public override string ReadAsString()
    		{
    			return("X: " + Convert.ToString(base.ReadRegister(0x42)) + " Y: " + Convert.ToString(base.ReadRegister(0x43)) + " Z: " + Convert.ToString(base.ReadRegister(0x44)));
    		}
    
    		public override void SelectNextMode()
    		{
    			return;
    		}
    
    		public override void SelectPreviousMode()
    		{
    			return;
    		}
    
    		public override string GetSensorName()
    		{
    			return (Convert.ToString (base.ReadRegister ((byte)0x10, (byte)0x07)));
    		}
    
    		public override int NumberOfModes()
    		{
    			return 1;
    		}
    
    		public override string SelectedMode()
    		{
    			return ("Mode 1");
    		}
    	}
    }
    
    using System;
    using MonoBrickFirmware;
    using MonoBrickFirmware.Display;
    using MonoBrickFirmware.UserInput;
    using System.Threading;
    using MonoBrickFirmware.Sensors;
    
    namespace MonoBrickHelloWorld
    {
    	class MainClass
    	{
    		public static void Main (string[] args)
    		{
    			EventWaitHandle stopped = new ManualResetEvent (false);
    			MindsensorsAbsoluteIMU NewSensor = new MindsensorsAbsoluteIMU (SensorPort.In1);
    			ButtonEvents buts = new ButtonEvents ();
    
    			buts.EscapePressed += () => { 
    				stopped.Set ();
    			};
    
    			buts.EnterPressed += () => {
    				LcdConsole.WriteLine(NewSensor.ReadAsString());
    			};
    
    			LcdConsole.WriteLine ("Hello World");
    			 
    			stopped.WaitOne ();
    		}
    	}
    }

    (Why can’t we attach .cs files?)

    • This reply was modified 9 years, 3 months ago by Author ImageTcm0.
    in reply to: How to use AbsoluteIMU-ACG sensor? #4943
    Author Image
    Tcm0
    Participant

    It may use the 9V I2C Sensor mode.

    in reply to: How to use AbsoluteIMU-ACG sensor? #4941
    Author Image
    Tcm0
    Participant

    Your sensor is an I2C sensor. You can find information about the usage of an I2C sensor at https://github.com/Larsjep/monoev3/blob/release/MonoBrickFirmware/Sensors/HTColorSensor.cs. Other information about the adresses to be read etc. can be found in the official sourcecode for the NXC library: http://www.mindsensors.com/index.php?module=documents&JAS_DocumentManager_op=viewDocument&JAS_Document_id=198 (IMU-lib.nxc). The adress of the I2C sensor appears to be 0x22 as you can find in the demo (IMU-demo.nxc).

    in reply to: Connection between C#, EV3, Lego Mindstorms Edu.. #4900
    Author Image
    Tcm0
    Participant

    I think that you can write a message to the EV3’s bluetooth message box by using http://www.monobrick.dk/MonoBrickDocumentation/class_mono_brick_1_1_e_v3_1_1_mailbox.html.

    in reply to: Controlling I2C-Sensors on EV3 #4898
    Author Image
    Tcm0
    Participant
    in reply to: I2C communication PCF8574AP #4884
    Author Image
    Tcm0
    Participant

    Are you sure that the PCF8574AP is no 9V sensor? In that case you would have to use another mode.

Viewing 15 posts - 46 through 60 (of 107 total)
Posted in

Make a donation