Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "mbed.h"
- DigitalOut led1(LED1);
- DigitalOut R0(PA_13);
- DigitalIn B11(PB_14);
- DigitalIn B22(PB_13);
- InterruptIn B1(PB_14);
- InterruptIn B2(PB_13);
- BusInOut pins(PA_9, PA_7, PC_6, PC_8);
- int liczba[2] = {0x1D, 0x05};
- int liczba1 = 1;
- void liczenie()
- {
- while(B22){
- liczba1++;
- pins = liczba[liczba1];
- wait(0.05);
- if(liczba1==2) {
- liczba1 = 0;
- }}
- }
- void czek(){
- wait(0.001);
- }
- int main()
- {
- B11.mode(PullUp);
- B22.mode(PullUp);
- R0=1;
- B1.fall(&liczenie);
- B2.fall(&czek);
- pins.output();
- pins = liczba[2];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement