Brick Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The main Brick class allowing low level access to motors and sensors
public class Brick : IDisposable
type Brick = class
interface IDisposable
Public Class Brick
Implements IDisposable
- Inheritance
-
Brick
- Implements
Brick(Byte, Int32, Int32) |
Initialize the brick including SPI communication |
Brick |
Stores all the information regarding the Brick This includes id, hardware and firmware versions |
Brick |
Stores the voltage information |
Spi |
used to store the SPI Address used mainly when multiple bricks in a raw or not the default SPI address up to 254 addresses supported |
Dispose() |
Reset the brick, stop the motors, release sensors |
Get |
Read the 20 charactor BrcikPi3 board name |
Get |
Read the firmware version |
Get |
Read the hardware version |
Get |
Read the 128 - bit BrcikPi3 hardware serial number |
Get |
Read the 20 charactor BrickPi3 manufacturer name |
Get |
Read a motor encoder in degrees |
Get |
Read a motor status |
Get |
Get the sensor data from a specific port The following sensor types each return a single value: NONE----------------------- 0 TOUCH---------------------- 0 or 1(released or pressed) NXT_TOUCH------------------ 0 or 1(released or pressed) EV3_TOUCH------------------ 0 or 1(released or pressed) NXT_ULTRASONIC------------- distance in CM NXT_LIGHT_ON--------------- reflected light NXT_LIGHT_OFF-------------- ambient light NXT_COLOR_RED-------------- red reflected light NXT_COLOR_GREEN------------ green reflected light NXT_COLOR_BLUE------------- blue reflected light NXT_COLOR_OFF-------------- ambient light EV3_GYRO_ABS--------------- absolute rotation position in degrees EV3_GYRO_DPS--------------- rotation rate in degrees per second EV3_COLOR_REFLECTED-------- red reflected light EV3_COLOR_AMBIENT---------- ambient light EV3_COLOR_COLOR------------ detected color EV3_ULTRASONIC_CM---------- distance in CM EV3_ULTRASONIC_INCHES------ distance in inches EV3_ULTRASONIC_LISTEN------ 0 or 1(no other ultrasonic sensors or another ultrasonic sensor detected) EV3_INFRARED_PROXIMITY----- distance 0 - 100 % The following sensor types each return a list of values CUSTOM--------------------- Pin 1 ADC(5v scale from 0 to 4095), Pin 6 ADC(3.3v scale from 0 to 4095), Pin 5 digital, Pin 6 digital I2C------------------------ the I2C bytes read NXT_COLOR_FULL------------- detected color, red light reflected, green light reflected, blue light reflected, ambient light EV3_GYRO_ABS_DPS----------- absolute rotation position in degrees, rotation rate in degrees per second EV3_COLOR_RAW_REFLECTED---- red reflected light, unknown value(maybe a raw ambient value ?) EV3_COLOR_COLOR_COMPONENTS- red reflected light, green reflected light, blue reflected light, unknown value(maybe a raw value ?) EV3_INFRARED_SEEK---------- a list for each of the four channels.For each channel heading(-25 to 25), distance(-128 or 0 to 100) EV3_INFRARED_REMOTE-------- a list for each of the four channels.For each channel red up, red down, blue up, blue down, boadcast |
Get |
Get the 3.3v circuit voltage |
Get |
Get the 5v circuit voltage |
Get |
Get the 9v circuit voltage |
Get |
Get the battery voltage |
Offset |
Offset a motor encoder |
Set |
Set the SPI address of the BrickPi3 |
Set |
Set the Led intensity from 0 (off) to 100 (fully bright), 255 used to return the led to BrickPi3 management |
Set |
Set the motor target speed in degrees per second |
Set |
Set the motor speed limit |
Set |
Set the motor target position in degrees |
Set |
Set the motor target position KD constant If you set KP higher, the motor will be more responsive to errors in position, at the cost of perhaps overshooting and oscillating. KD slows down the motor as it approaches the target, and helps to prevent overshoot. In general, if you increase kp, you should also increase KD to keep the motor from overshooting and oscillating. |
Set |
Set the motor target position KP constant If you set KP higher, the motor will be more responsive to errors in position, at the cost of perhaps overshooting and oscillating. KP slows down the motor as it approaches the target, and helps to prevent overshoot. In general, if you increase KP, you should also increase KD to keep the motor from overshooting and oscillating. |
Set |
Set the motor power in percent |
Set |
Set the sensor type |
Spi |
Read a 16 - bit value over SPI |
Spi |
Read a 32 - bit value over SPI |
Spi |
Conduct a SPI transaction |
Spi |
Send a 16 - bit value over SPI |
Spi |
Send a 24 - bit value over SPI |
Spi |
Send a 32 - bit value over SPI |
Spi |
Send a 8 - bit value over SPI |
Product | Versions |
---|---|
.NET IoT Libraries | 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 2.0.0, 2.1.0, 2.2.0 |