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>
- #include<data.h>
- extern serial Serial;
- void serial_check(int id, void* ptrt){
- static int broj1 = -9548, broj2; //lupio sam neku rendom vrednost
- if(Serial.available()){
- if(broj1 != -9548){
- broj2 = atoi(Serial.readString());
- Serial.println(broj1 + broj2);
- Serial.println("Sabiranje zavrseno... Ceka se unos prvog broja: ");
- broj1 = -9548;
- }else if(broj1 == -9548){
- broj1 = atoi(Serial.readString());
- Serial.println("Ceka se unos drugog broja: ");
- }
- }
- }
- void setup()
- {
- Serial.begin(9600);
- Serial.println("Ceka se unos prvog broja: ");
- createTask(serial_check, 100, TASK_ENABLE, NULL);
- }
- void loop()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment