Registered Users          New User?
Printer-friendly version
 

A compendium of functions available for Machine Science projects.

Search full text


Browse the glossary using this index

Special | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O
P | Q | R | S | T | U | V | W | X | Y | Z | ALL

Page:  1  2  3  4  5  6  7  8  9  10  (Next)
  ALL

#
#defines:

Requires: #include "mxapi.h"

Purpose: General purpose defines for code readability.

Syntax: N/A

Defines:
  • DISABLE: 0
  • ENABLE: 1
  • FALSE: 0
  • TRUE: 1
  • LOW: 0
  • HIGH: 1
  • OFF: 0
  • ON: 1
  • OUTPUT: 0
  • INPUT: 1
  • UNPRESSED: 0
  • PRESSED: 1
  • NO: 0
  • YES: 1
  • TOGGLE: 2
Returns: N/A
A
adc_init:

Requires: #include "adc.h"

Purpose: Initialize the analog-to-digital converter.

Syntax: adc_init(REFERENCE,OUTPUT);

REFERENCE:
  • ADC_AREF_INTERNAL: Reference voltage on pin 7 (VCC)
  • ADC_AREF_EXTERNAL: Reference voltage on pin 21 (AREF)
OUTPUT:
  • ADC_8BIT: Output is an 8-bit number
  • ADC_10BIT: Output is a 10-bit number
Returns: N/A

Availability: ATMega ONLY
adc_read:

Requires: #include "adc.h"

Purpose: Read the the analog-to-digital converter value on a specific pin.

Syntax: adc_read(PORT);

PORT:
  • 0: Port C0
  • 1: Port C1
  • 2: Port C2
  • 3: Port C3
  • 4: Port C4
  • 5: Port C5
Returns: An 8-bit or a 10-bit value, depending on how the ADC is initialized.

Availability: ATMega ONLY
analog_input:



Requires: #include <machinescience.h> and #include <mastermod.h>

Purpose: Enable or disable analog input on XIPMod Master Module.

Syntax: analog_input(STATE);

STATE:

  • ENABLE: Enables analog input
  • DISABLE: Disables analog input
Returns: N/A

Availability: XIPMods ONLY

C
clear_bit:

Requires: #include "mxapi.h"

Purpose: Set the value of an output pin low (0 volts).

Syntax: clear_bit(PORT_B0);

Returns: N/A

Availability: ATMega ONLY
D
delay_ms:

Requires: #include "delay.h"

Purpose: Delay routine, measured in milliseconds.

Syntax: delay_ms(1000);

Returns: N/A
delay_us:

Requires: #include "delay.h"

Purpose: Delay routine, measured in microseconds.

Syntax: delay_us(1000);

Returns: N/A
E
end:

Requires: #include <mxapi.h> or #include <machinescience.h>

Purpose: End program.

Syntax: end();

Returns: N/A

G
gears_motor:

Requires: #include <machinescience.h> and #include <mastermod.h>

GEARS speed control must be enabled, using gears_speed_control(ENABLE);

Purpose: Control DC motors, using GEARS Speed Controllers connected to Master Module output ports.

Syntax: gears_motor(MOTOR, SPEED);

MOTOR:
  • 0 - 5: Controls GEARS speed controller on output ports 0 to 5

SPEED:
  • -100: Full speed counterclockwise
  • 0: Stop
  • +100: Full speed clockwise

Returns: N/A

Availability: XIPMods ONLY
gears_robot:

Requires: #include <machinescience.h> and #include <mastermod.h>

GEARS speed motor control must be enabled, using gears_speed_control(ENABLE);

Purpose: Control a two-motor robot, using GEARS Speed Controllers connected to Master Module output ports 0 and 1.

Syntax: gears_robot(DIRECTION, SPEED);

DIRECTION:
  • FORWARD
  • REVERSE
  • SPIN_LEFT
  • SPIN_RIGHT
  • STOP

SPEED:
  • 0: Stop
  • +100: Full speed

Returns: N/A

Availability: XIPMods ONLY

Page:  1  2  3  4  5  6  7  8  9  10  (Next)
  ALL