38 lines
631 B
C++
38 lines
631 B
C++
// plotter.h
|
|
|
|
#ifndef _PLOTTER_h
|
|
#define _PLOTTER_h
|
|
|
|
#include<util/delay.h>
|
|
#include "writepin.h"
|
|
#include "point.h"
|
|
#include "pwm.h"
|
|
#include "writepin.h"
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
class Plotter
|
|
{
|
|
private:
|
|
Pwm16b _pwm;
|
|
Point currentPos = {0, 0};
|
|
|
|
volatile unsigned char *_penPort;
|
|
char _penPin;
|
|
|
|
public:
|
|
Plotter(volatile unsigned char *penPort, const char penPin);
|
|
void demo();
|
|
void basicposition();
|
|
void pd();
|
|
void pu();
|
|
void moveto(Point *pt);
|
|
void moveto(uint16_t nx,uint16_t ny);
|
|
|
|
Point getCurrentPos();
|
|
};
|
|
|
|
|
|
#endif
|
|
|