Guest User

Untitled

a guest
May 29th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. class UDrive {
  2.     public:
  3.         UDrive(HardwareSerial*);
  4.         bool connect();
  5.     private:
  6.         bool fileopen;
  7.         HardwareSerial connection;
  8.            
  9. };
  10.  
  11. UDrive::UDrive(HardwareSerial* newcon) {
  12.     fileopen = false;
  13.     connection = newcon;
  14. }
  15.  
  16. bool UDrive::connect() {
  17.     connection.flush();
  18.  
  19.     do {                       
  20.         connection.print(0x00, BYTE);
  21.     } while(connection.available() == 0);
  22.  
  23.     return true;
  24. }
  25.  
  26. /* Errors returned:
  27.  
  28. C:\Users\Steve\AppData\Local\Temp\build7714903766476072860.tmp\/udrive.cpp:34: error: request for member 'flush' in '((UDrive*)this)->UDrive::connection', which is of non-class type 'HardwareSerial*'
  29.  
  30. C:\Users\Steve\AppData\Local\Temp\build7714903766476072860.tmp\/udrive.cpp:37: error: request for member 'print' in '((UDrive*)this)->UDrive::connection', which is of non-class type 'HardwareSerial*'
  31.  
  32. C:\Users\Steve\AppData\Local\Temp\build7714903766476072860.tmp\/udrive.cpp:38: error: request for member 'available' in '((UDrive*)this)->UDrive::connection', which is of non-class type 'HardwareSerial*'
  33. */
Advertisement
Add Comment
Please, Sign In to add comment