Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <libpiface-1.0/pfio.h>
- #include <iostream>
- int main()
- {
- pfio_init();
- int a, b, c, d;
- char znak;
- bool test = true;
- while (true)
- {
- if(pfio_digital_read(0)==1)
- {
- while(test)
- {
- if(pfio_digital_read(0)==0)
- {
- std::cout<<"A"<<std::endl;
- test = false;
- }
- }
- test = true;
- }
- if(pfio_digital_read(1)==1)
- {
- while(test)
- {
- if(pfio_digital_read(1)==0)
- {
- std::cout<<"B"<<std::endl;
- test = false;
- }
- }
- }
- if(pfio_digital_read(2)==1)
- {
- while(test)
- {
- if(pfio_digital_read(2)==0)
- {
- std::cout<<"C"<<std::endl;
- test = false;
- }
- }
- test = true;
- }
- if(pfio_digital_read(3)==1)
- {
- while(test)
- {
- if(pfio_digital_read(3)==0)
- {
- std::cout<<"D"<<std::endl;
- test = false;
- }
- }
- test = true;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement