Und hier mein erstes Progrämmchen (als "Spin-Off" zu https://www.roboternetz.de/community...-braucht-Hilfe).
viele GrüßeCode:/* randomtest.c - light show with random numbers. * * adu 08 Aug 2011 created * *********************************************************************/ #include "RP6RobotBaseLib.h" int main (void) { /* * 1. variables * ============ */ int j; /* * 2. inititialize * ============== */ initRobotBase (); srandom (1234567); // start value of number generator /* * 3. check all LEDs * ================= */ mSleep (1000); setLEDs (0b111111); mSleep (1000); setLEDs (0b000000); mSleep (500); /* * 4. main loop with light show * ============================ */ while(true) { j = random () % 64; setLEDs (j); mSleep (200); } return 0; }
Andreas







Zitieren

)

Lesezeichen