1

  1. include "mbed.h" BusOut Bar(D4,D5,D6,D7,D8,D9,D10,D11); AnalogIn ain(A0); int a; void speed() { a=ain.read(); wait(a+0.1); } void showled() { for(int i=1; i<8 ;i++) { Bar=1<<i; speed(); } for(int i=7; i>0 ;i) { Bar=1<<i; speed(); } } int main() { while(1) { showled(); } }


Please log in to post comments.