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.
Fork of pixy by
PixyLinkUART.h
- Committer:
- balsamfir
- Date:
- 2016-03-13
- Revision:
- 8:6cd36ded7c4e
- Parent:
- 0:ed8dc4531ac1
File content as of revision 8:6cd36ded7c4e:
#ifndef TUIASI_PIXYLINKUART_H
#define TUIASI_PIXYLINKUART_H
#include "Serial.h"
#include "PixyLink.h"
class PixyLinkUART : public PixyLink, private Serial
{
public:
    PixyLinkUART(PinName tx, PinName rx) :
        Serial(tx, rx) {
        baud(19200);
    };
    virtual uint16_t getWord() {
        uint8_t data[2] = {0, 0};
        read(data, 2);
        return ((uint16_t)data[1] << 8) | data[0];
    };
    virtual uint8_t getByte() {
        uint8_t data = 0;
        read(&data, 1);
        return data;
    };
    virtual int8_t send(uint8_t *data, uint8_t len) {
        return write(data, len);
    };
private:
};
#endif //TUIASI_PIXYLINKUART_H
            
    