Advertisement
alseambusher

Untitled

Sep 21st, 2024
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. void loop()
  2. {
  3.     while (!Serial.available())
  4.         ;
  5.    
  6.     auto message = Serial.readStringUntil('#');
  7.     String parsed[3];
  8.     auto count = split(message, parsed);
  9.     Log.notice("comms : %s %d" CR, message.c_str(), count);
  10.  
  11.     if (count == 3)
  12.     {
  13.         if (parsed[0] == "pan")
  14.         {
  15.  
  16.             pnts[parsed[1].toInt()].pan(parsed[2].toInt());
  17.         }
  18.         if (parsed[0] == "tilt")
  19.         {
  20.             pnts[parsed[1].toInt()].tilt(parsed[2].toInt());
  21.         }
  22.     } else if (count == 2)
  23.     {
  24.         if (parsed[0] == "led") {
  25.            kakashi::led::displayImage(kakashi::led::SHARINGAN[parsed[1].toInt()]);
  26.         }
  27.     }
  28.    
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement