Don't ad-block us - support your favorite websites. We have safe, unobstrusive, robotics related ads that you actually want to see - see here for more.
0 Members and 1 Guest are viewing this topic.
if(button_pressed()) { PORT_ON(PORTA,6); delay_ms(100); PORT_OFF(PORTA,6); // triggers MP3 card. (is this part even right?) servo(PORTA,7,360); // represents the series of servo events }
Using the Trigger Inputs:PORT_ON brings the pin high, to 5VPORT_OFF brings the pin low, to 0V
Gosh! An admin...and I didn't even do anything wrong. Thanks for responding none the less.
a2dSetReference(ADC_REFERENCE_256V);
All pins are I/O, meaning input and output. The ADC can be configured to do output.
That said, with all the other pins already available, no need!
However, my Axon code is really really old/outdated. I recommend using WebbotLib.
Sor_Utils.h seems to have the configuration stuff, but I don't want to change anything since I am not exactly sure what I am doing and don't want to screw things up.
As long as things work and I understand it, I could care less how old or outdated it is. Its not like I am refusing to apply security updates to my computer OS.
DDRA = 0b00000000; //configure ports for inputDDRF = 0b11111111; //configure all F ports for outputDDRK = 0b11111111; //configure all K ports for outputPORTF = 0b00000000; //make sure pull-up resistors are turned offPORTK = 0b00000000; //make sure pull-up resistors are turned off
if(bit_is_set(PINA, 1)) // set via push button switch PORT_OFF(PORTF,6); // sends 0V to MP3Trigger (active low inputs); plays the track delay_ms(200); // wait a bit to make sure it starts PORT_ON(PORTF,6); // reset servo(PORTA,7,360); // represents the series of servo events
DDRA = 0b00000000; // configure A ports for inputDDRF = 0b11111111; // configure F ports for outputPORTF = 0b11111111; // make sure pull-up resistors are turned on