Hallo robob,
ich habe 'mal einen Plan gemacht, wie man an den XBUS auf der Experimentierplatine 3 LEDs an den RP6 ohne Control M32 anschliessen kann.
Als LEDs würde ich je eine rote, gelbe, grüne 3mm-LED Low Current nehmen.
Da wo bei den LEDs das "K" steht ist die Kathode (= kurzer Draht der LED).
Als Vorwiderstände (R) nehme ich dreimal 1,5 kOhm.
Hier ein einfaches "Blinkprogramm" für die 3 LEDs:
Gruß DirkCode:/* * **************************************************************************** * RP6 ROBOT SYSTEM - RP6 BASE TESTS * **************************************************************************** * Test: Base Test 1 * Author(s): D. Ottensmeyer * **************************************************************************** * Description: * This is a small test for the RP6 ROBOT BASE. * * ############################################################################ * The Robot does NOT move in this example! You can simply put it on a table * next to your PC and you should connect it to the PC via the USB Interface! * ############################################################################ * **************************************************************************** */ /*****************************************************************************/ // Includes: #include "RP6RobotBaseLib.h" // The RP6 Robot Base Library. // Always needs to be included! /*****************************************************************************/ // Defines: /*****************************************************************************/ // Variables: /*****************************************************************************/ // Functions: /*****************************************************************************/ // Main function - The program starts here: int main(void) { initRobotBase(); // Always call this first! The Processor will not // work correctly otherwise. // --------------------------------------- // Write messages to the Serial Interface // (here it is a RP6 text logo): writeString_P("\n\n _______________________\n"); writeString_P(" \\| RP6 ROBOT SYSTEM |/\n"); writeString_P(" \\_-_-_-_-_-_-_-_-_-_/\n\n"); writeString_P("################\n"); writeString_P("<<RP6 Base>>\n"); writeString_P(" Base - Test 1 \n"); writeString_P(" Version 1.00 \n"); writeString_P("################\n\n"); mSleep(2500); // Clear the four Status LEDs: setLEDs(0b0000); /*****************************************************************************/ // Main test program: DDRA |= (E_INT1); // PA4 (IT1) als Ausgang definieren DDRC |= (SCL | SDA); // PC0, PC1 als Ausgänge definieren while (true) { PORTA |= E_INT1; // PA4 high mSleep(1000); PORTA &= ~E_INT1; // PA4 low PORTC |= SCL; // PC0 high mSleep(1000); PORTC &= ~SCL; // PC0 low PORTC |= SDA; // PC1 high mSleep(1000); PORTC &= ~SDA; // PC1 low } /*****************************************************************************/ // End of main: return 0; } /****************************************************************************** * Additional info * **************************************************************************** * Changelog: * - v. 1.0 (initial release) 01.03.2008 by D. Ottensmeyer * * **************************************************************************** */ /*****************************************************************************/







Zitieren

Lesezeichen