wheelsmanx

ArduinoToC++ Source.cpp

May 29th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <tchar.h>
  3. #include "Arduino.h"
  4.  
  5.  
  6. class Arduino {
  7. public:
  8. Serial* Port;
  9. std::vector <std::string> Output;
  10. Arduino(const char *input) {
  11. this->Port = CreatePort();
  12. this->Output = ArduinoFunction(Port, input);
  13. }
  14. Arduino() {
  15. this->Port = CreatePort();
  16. }
  17. void passVariable(const char *input) {
  18. this->Output = ArduinoFunction(Port, input);
  19. }
  20. };
  21.  
  22. // application reads from the specified serial port and reports the collected data
  23. int _tmain(int argc, _TCHAR* argv[])
  24. {
  25. //Create Your Device
  26. Arduino uno;
  27. //Pass it a variable
  28. uno.passVariable("6");
  29. //Get Ouput as a vector of strings
  30. vout(uno.Output);
  31. //repeat
  32.  
  33.  
  34. system("pause");
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment