Demo for FibonacciLFSR Class

Dependencies:   mbed FibonacciLFSR

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "FibonacciLFSR.h"
00003 #include <bitset>
00004 #include <iostream>
00005 
00006 Serial pc(USBTX, USBRX);
00007 FibonacciLFSR myLFSR(FibonacciLFSR::LFSR_4);
00008 
00009 // Led order is mixed up to increase "random effect" at output
00010 BusOut myleds(LED2, LED4, LED3, LED1);      // See also "PortOut"
00011 
00012 int main() {
00013     while(1){
00014         myleds = myLFSR.getRandom();
00015         wait(0.08);
00016     }
00017 }