Society of Robots - Robot Forum
Software => Software => Topic started by: Techman09 on November 09, 2008, 02:48:59 PM
-
How do I set a pin to Hi or Low when outputting to a motor controller or H-bridge???
I am looking for a way to define my drive functions for 4WD inside of the society of robot
"hardware.c" function lists.
I have searched the library documents, but I need some help here.
I am trying to figure out how to make the I/O lines either hi or low.
Thanks.
-
What µC? what language?
-
Using C, trying to alter the files on this site for controlling motors instead of servos.
and the Axon.
-
something like maybe
PORTE6 = 00000001
or
PORTE6= 1
i amthe code to accomplish this in "C". It seems like this would be so easy to come by, but for some reason, I cannot find anything to manipulate the high or low value for an I/O pin.
-
i dont know about a motor because im very new but i know i can turn a led on and off
#include <avr/io.h>
DDRB 0b11111111; // Set all of port b to outputs use 0 for inputs
PORTB 0b01000000; // set pin to high or low using 1 or 0
-
Include SoR_Utils.h and then use something like this,
PORT_ON(PORTD, 7);
and
PORT_OFF(PORTD, 7);