#define isn’t used in C# (well it is sort of, see below, but the general usage isn’t available) You can’t use it to create macros. Bloody annoying, but get over it – you can’t! So instead use constants. See constants here How #define is used in C# #define is only used to create something to test […]
All posts by
Variables
The structure below shows the various basic types of C# and the types they map to in the .Net framework. C# Short Name .Net Class Declaration Description bool Boolean bool isValid = true; 8 bit true or false sbyte SByte sbyte b = -1 signed 8 bit integer byte Byte byte b = 1; 8 bit […]
Get I2C Port Names
//Get I2C Port Name string AqsFilter = I2cDevice.GetDeviceSelector(); var dis = await DeviceInformation.FindAllAsync(AqsFilter); if (dis.Count > 0) System.Diagnostics.Debug.WriteLine(dis[0].Id);
Using Error Catching
Throw an error
Writing to the console
System.Diagnostics.Debug.WriteLine(“My Value: ” + Convert.ToString(MyVariable)); or using System.Diagnostics; Debug.WriteLine(“My Value: ” + Convert.ToString(MyVariable));
RPi Using The I2C Interface
See the IO Pins page here for any extensions needed by Visual Studio and to enable the IO pins. Namespaces Initialise I2C Port For A Device Write Bytes Write Then Read Bytes Read Bytes Disposing Of A I2C Device Object
RPi IO Pins
Visual Studio Requirements Windows IoT Extension for UWP extension is needed – right clicking on your project. Then, select Add > Reference.. Select Universal Windows > Exensions > Windows IoT Extension for the UWP, select the latest version and press OK Add IO Pins Capability (Includes adding SPI port, I2C port, etc capabilities) To enable […]
Web Configuration Interface
To access the web configuration interface use your browser with the following URL: http://<ip_address_of_your_device>:8080/ If you don't know the device IP address you can use the Microsoft "Windows 10 IoT Core Dashboard" application to find the device and give you its IP address. Log in: Username: Administrator Password: your password
Running The Application
Running The Application On Your Device Select ‘Remote Machine’ from the run target drop down. Your device will likely be in the Auto Detected box. Alternatively enter the IP address of the device. Changing IP address later To change the device IP address select Menu > Debug > [your project name] Properties… We also have […]
Our Raspberry Pi Site
Please see our other resourse site for more information about the Raspberry Pi http://www.raspberry-projects.com/pi/