LEGO Mindstorms EV3


Variable Types

Variable declarations

                                                  

Global and local variable types:

    DATAF   Name                                  // float            32 bit
    DATA32  Name                                  // signed long      32 bit
    DATA16  Name                                  // signed int       16 bit
    DATA8   Name                                  // signed char       8 bit
    DATAS   Name Size                             // signed char array

Fixed array types:

    ARRAYF  Name Size                             // float array
    ARRAY32 Name Size                             // signed long array
    ARRAY16 Name Size                             // signed int array
    ARRAY8  Name Size                             // signed char array (same as DATAS)

Sub call parameter types:

    IN_F    Name                                  // float        input parameter
    IN_32   Name                                  // signed long  input parameter
    IN_16   Name                                  // signed int   input parameter
    IN_8    Name                                  // signed char  input parameter
    IN_S    Name Size                             // signed char array input parameter

    OUT_F   Name                                  // float        input parameter
    OUT_32  Name                                  // signed long  input parameter
    OUT_16  Name                                  // signed int   input parameter
    OUT_8   Name                                  // signed char  input parameter
    OUT_S   Name Size                             // signed char array input parameter

    IO_F    Name                                  // float        input/output parameter
    IO_32   Name                                  // signed long  input/output parameter
    IO_16   Name                                  // signed int   input/output parameter
    IO_8    Name                                  // signed char  input/output parameter
    IO_S    Name Size                             // signed char array input/output parameter

Assigning values to variables

    DATAF     MyDataF                             // Declare      DATAF MyDataF

    MOVEF_F(3.14F,MyDataF)                        // Assign       MyDataF  =  3.14


    DATA32    MyData32                            // Declare      DATA32 MyData32

    MOVE32_32(1000000,MyData32)                   // Assign       MyData32  =  1000000


    DATA16    MyData16                            // Declare      DATA16 MyData16

    MOVE16_16(10000,MyData16)                     // Assign       MyData16  =  10000


    DATA8     MyData8                             // Declare      DATA8 MyData8

    MOVE8_8(100,MyData8)                          // Assign       MyData8  =  100


    DATAS     MyDataS 16                          // Declare      DATAS MyDataS[16]

    STRINGS(DUPLICATE,'My String\r\n',MyDataS)    // Assign       strcpy(MyDataS,"My String\r\n")



      special characters used in strings:

        '\r' = CR   (0x0D)
        '\n' = LF   (0x0A)
        '\t' = TAB  (0x09)
        '\q' = '    (0x27)

LEGO® Robotics Firmware Documentation
Confidential Information © 2013 The LEGO Group