Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: pixy2 pixy2_10_0042 0000Non_stop_code_v1 0000Non_stop_code_v3 ... more
Fork of pixy by
PixyLinkUART.h
00001 #ifndef TUIASI_PIXYLINKUART_H 00002 #define TUIASI_PIXYLINKUART_H 00003 00004 #include "Serial.h" 00005 #include "PixyLink.h" 00006 00007 class PixyLinkUART : public PixyLink, private Serial 00008 { 00009 public: 00010 PixyLinkUART(PinName tx, PinName rx) : 00011 Serial(tx, rx) { 00012 baud(38400); 00013 }; 00014 00015 virtual uint16_t getWord() { 00016 uint8_t data[2] = {0, 0}; 00017 read(data, 2); 00018 return ((uint16_t)data[1] << 8) | data[0]; 00019 }; 00020 00021 virtual uint8_t getByte() { 00022 uint8_t data = 0; 00023 read(&data, 1); 00024 return data; 00025 }; 00026 00027 virtual int8_t send(uint8_t *data, uint8_t len) { 00028 return write(data, len); 00029 }; 00030 00031 00032 private: 00033 }; 00034 #endif //TUIASI_PIXYLINKUART_H
Generated on Tue Jul 12 2022 15:51:01 by
1.7.2
