A compendium of functions available for Machine Science projects.
| # |
| #defines: Requires: #include "mxapi.h" Purpose: General purpose defines for code readability. Syntax: N/A Defines:
|
| A |
| adc_init: Requires: #include "adc.h" Purpose: Initialize the analog-to-digital converter. Syntax: adc_init(REFERENCE,OUTPUT); REFERENCE:
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:
Availability: ATMega ONLY |
| analog_input:
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:
SPEED:
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:
SPEED:
Returns: N/A Availability: XIPMods ONLY |