The ARC Script Manual.

G.)

GetADC( Port ) Returns the 8 Bit ADC value of the specified port Example: $x = GetADC(adc0)

GetADC12( Port ) Returns the 12 Bit ADC value of the specified port on the EZ-B v4 Example: $x = GetADC12(adc0)

GetArraySize( variable ) Returns the size of the specified array variable. *Note: The variable passed as a parameter must be in quotations. See the example below. Example: $x = GetArraySize($myArray)

GetAsByte( value ) Returns the byte of the integer or first character of string. If you pass 75 as the value, you will get the ASCII value of the letter K Example: $value = GetAsByte(H) Example: $value = GetAsByte($x)

GetBit( value, bit ) Returns the value of the specified bit. The LSB is bit 0, and MSB is bit 7. Example: $bit = GetBit(255, 1)

GetByte( value ) Returns the ASCII Ordinal value of a byte or byte array. Technically, this function returns a number and not specifically a byte. The number of bytes in the variable will determine the size of the integer returned. If one byte is passed, an 8 bit number is returned. If two bytes are passed, a 16 bit number is returned. If 4 bytes are passed, a 32 bit number is returned. If 6 bytes are passed, a 64 bit number is returned. If the variable contains 0x37, this function will return an integer value of 53. Use this function to convert data read by i2c into ordinal values. Example: $value = GetByte(H) Example: $value = GetByte($x)

GetByteAt( value, index ) Returns the ASCII Ordinal value of the byte at the specified location within the array. If the byte is 0x05, this function will return an integer value of 53. Use this function to convert data read by i2c into ordinal values. The Index is zero based, which means 0 (zero) is the first character. Example: $value = GetByteAt(Hello World, 2) Example: $value = GetByteAt($x, 2)

GetCharAt( value, index ) There are two methods to obtain a character within a string. This method, which is GetCharAt(), or using the [] square brackets. See the example below. Returns the character at the specified index. If the character at the specified position is outside of readable ASCII, you will want to use GetByteAt() or GetByte() functions instead. The Index is zero based, which means 0 (zero) is the first character. Example: $char = GetCharAt(Hello World, 2) Example: $char = GetCharAt($x, 2) Example: $byte = $x[3] Example: $byte = $x[$y]

GetControlValue( windowName, ControlCommandValues ) Gets a value from the window by its name. Look further down in this document for available ControlCommand() parameters under the ControlCommand Values section. Example: $x = GetControlValue( "ADC Graph", pause )

GetCPUTemp() Returns the CPU Temperature of the EZ-B v4 Example: $x = GetCPUTemp()

GetDigital( Port ) Returns the Digital value of the specified port as a 0 or 1 Example: $x = GetDigital(d0)

GetPing( trigger port, echo port ) Return the Ping HC-SR04 value of the specified port Example: $x = GetPing(d0, d1)

GetPWM (digitalPort) Gets the PWM (Pulse Width Modulation) of specified port PWM is between 0 and 100 Example: $x = GetPWM(D14)

GetRandom( Min, Max ) Returns a random number between Min and Max Example: $x = GetRandom(10, 50)

GetRandomUnique( Min, Max ) Returns a random number between Min and Max This function attempts to make the number unique from the last time it was called Example: $x = GetRandomUnique(10, 50)

GetServo( Port ) Returns the last specified servo Position value of the servo port. Servo position is between 1 and 180 Example: $x = GetServo(d0)

GetServoSpeed( Port ) Returns the servo Speed value of the specified port Speed is between 0 and 10 Example: $x = GetServoSpeed(d0)

GetSpeed( ) Returns the global Movement Speed value Speed is between 0 and 255 The speed can be viewed in the Script Variable Viewer Example: $x = GetSpeed()

GetSpeedLeft( ) Returns the global Movement Speed value of Left wheel Speed is between 0 and 255 The speed can be viewed in the Script Variable Viewer Example: $x = GetSpeedLeft()

GetSpeedRight( ) Returns the global Movement Speed value of Right wheel Speed is between 0 and 255 The speed can be viewed in the Script Variable Viewer Example: $x = GetSpeedRight()

GetVoltage() Returns the EZ-B v4 Battery Voltage Example: $x = GetVoltage()

GetVolume() Gets the volume of the EZ-B v4 speaker The volume will be a value between 0 (quite), 100 (loud), 200 (2x over drive) The volume can be viewed in the Script Variable Viewer Example: $x = GetVolume(50)

GPSStop( latitude, longitude, resolution ) Uses the attached GPS control and stops the Movement Panel when the coordinates are within the specified resolution for the latitude and longitude. Example: GPSStop( 54.01438, -110.4931, 0.0005)

Goto( label ) Goto a specific :Label location Example: Goto(My_Label)


ARC Pro

Upgrade to ARC Pro

Stay on the cutting edge of robotics with ARC Pro, guaranteeing that your robot is always ahead of the game.