Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<arduinoPlatform.h>
- #include<tasks.h>
- #include<interrupts.h>
- #include<stdio.h>
- #include<serial.h>
- #include<pwm.h>
- extern serial Serial;
- #define prek1 2
- #define prek2 7
- #define prek3 8
- #define prek4 35
- void konvertuj(int n,void *tptr){
- int rezultat=0;
- if(digitalRead(prek1)==HIGH) rezultat+=1;
- if(digitalRead(prek2)==HIGH) rezultat+=2;
- if(digitalRead(prek3)==HIGH) rezultat+=4;
- if(digitalRead(prek4)==HIGH) rezultat+=8;
- Serial.print("Rez ");
- Serial.print(rezultat);
- Serial.println(" ");
- }
- void setup()
- {
- Serial.begin(9600);
- createTask(konvertuj,1000,TASK_ENABLE,NULL);
- }
- void loop()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement