Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. //VB C++
  2.  
  3. #include<stdio.h>
  4. #include<stdlib.h>
  5. #include "Serial.h"
  6.  
  7. int main()
  8. {
  9. CSerial serial;
  10. if (serial.Open(4, 9600))
  11. OutputDebugStringA("Port opened successfully");
  12. char* lpBuffer = new char[500];
  13. while (lpBuffer == NULL){
  14. int nBytesRead = serial.ReadData(lpBuffer, 500);
  15. }
  16. OutputDebugStringA(lpBuffer);
  17. delete[]lpBuffer;
  18. serial.Close();
  19. }
  20.  
  21. //Arduino
  22.  
  23. #include "Arduino.h"
  24.  
  25. void setup()
  26. {
  27. Serial.begin(9600);
  28. }
  29.  
  30. void loop()
  31. {
  32. while(Serial.available()>0) Serial.read();{
  33. Serial.println("Welcome to the inside of your robot");
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement