void setup( void ) { P1DIR = 0b10010001; // Port 1 pins 7, 4, and 0 are outputs P1OUT = 0b10010000; // enable the H-bridge using pin 4 // and begin with pin 7 high and 1 low //P1OUT = 0; } void loop( void ) { P1OUT ^= 0b10000001; // toggle pins 7 and 0 to reverse motor delay( 2000 ); // each direction for 2 seconds }