Commands for EV3-API Initialization: command #include InitEV3(); FreeEV3();

explanation including Header Initialization of all EV3-Functions Closing of all EV3-Functions

Display: command bool LcdClean(); LcdPrintf(,,…);

explanation Erase Display Working like printf()

Help: parameter type char

explanation Color of text



Pointer to text

char*

value 1: black text 0: wihteteext with black background e.g. “Hello EV3“

Break: command void Wait();

explanation Break code for a given time

Help: parameter type explanation unsigned time in ms long possible to use the given macros or type directly the value

©Simón Rodriguez Perez, 2016

value MS_1…10 :1 10…100 :10 50…500 :50 100…900 :100 SEC_1…10 :1 5…20 :5 30 MIN_1

Inputs (Sensoren): Commands: command int setAllSensorMode(, ,,); int readSensor(); int setIRBeaconCH(, );

explanation Allocate of the sensor types of all 4 ports in the correct order (IN_1, IN_2, IN_3, IN_4) Readout of the actual sensor data Set Channel of the Beacon for Readout (default: Ch. 1 )

Help: parameter

type int char int

explanation Input-Ports Name und Mode of the connected Sensors Channel of the Beacon. Needed for: IR_SEEK and IR_REMOTE

value IN_1, IN_2, IN_3, IN_4 See next table BEACON_CH_1, BEACON_CH_2, BEACON_CH_3, BEACON_CH_4

Sensor type: Sensor No Sensor

NO_SEN

Touch sensor

TOUCH_PRESS

Light sensor

COL_REFLECT COL_AMBIENT COL_COLOR

Sonar sensor Gyroscope EV3 Infrared

US_DIST_MM GYRO_ANG GYRO_RATE IR_PROX IR_SEEK IR_REMOTE

©Simón Rodriguez Perez, 2016

explanation No sensor to the port connected Return of state (2 states possible) Return of the reflected light intensities in % Return of room light intensities in % Return of color

Return of distance in mm Return of angle in ° Return of gear rate in °/s Return of distance in % (up to 70cm) Position of the Beacon Controlling EV3 with Beacon

return value -1 Not pressed: 0 pressed: 1 0 to 100 0 to 100 0: transparent 1: black 2: blue 3: green 4: yellow 5: red 6: white 7: brown 0 to 2550 -180 to 180 -440 to 440 0 (Near) to 100 (Far) -25 to 25 BEACON_OFF BEACON_UP_LEFT BEACON_DOWN_LEFT BEACON_UP_RIGHT BEACON_DOWN_RIGHT BEACON_UP BEACON_DIAG_UP_LEFT

NXT Infrared NXT Temperature

NXT_IR_SEEKER NXT_TEMP_C Temperature in °C NXT_TEMP_F Temperature in °F

BEACON_DIAG_UP_RIGHT BEACON_DOWN BEACON_ON BEACON_LEFT BEACON_RIGHT 1 to 9 -55 to 128 -67 to 262

Outputs (Motoren): Controlling: command void OnFwdReg(, ); void OnRevReg(, ); void OnFwdSync(, ); void OnRevSync(, ); void Off(); void RotateMotor(, , );

explanation Forwards/backwards with given speed synchronized forwards/backwards with given speed (only working with two motors) Switch off motors Rotate with given speed for a defined angle (Code stops till the angle is reached)

Reading out: command int MotorRotationCount(); void ResetRotationCount(); char MotorPower();

explanation Rotation angle of the motors in ° Reset of rotation angle Actual motor speed

Help: parameter type int

explanation Output-ports



speed angle in °

char int

©Simón Rodriguez Perez, 2016

value OUT_A, OUT_B, OUT_C, OUT_D, OUT_AB, OUT_AC, OUT_AD, OUT_BC, OUT_BD, OUT_CD, OUT_ABC, OUT_BCD, OUT_ABCD, OUT_ALL 0 to 100

Buttons und LED: Functions for LED: command void SetLedPattern(); void SetLedWarning ();

explanation Changing color of LED behind buttons Activate/deactivate of warning. LED color cannot be changed while warning is set.

Functions for buttons: command word ButtonWaitForAnyPress(

Commands for EV3-API - GitHub

<Color> char. Color of text. 1: black text. 0: wihteteext with black background. <Text> .... LED color cannot be changed while warning is set. ... (1: true, 0: false).

403KB Sizes 75 Downloads 477 Views

Recommend Documents

No documents