daily_automated

This commit is contained in:
topicchi
2023-03-17 11:59:21 +00:00
parent 252ecca9cf
commit e2f276193e
4496 changed files with 1178007 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
/**
* Reads X/Y values from a PS/2 mouse connected to an Arduino
* using the PS2Mouse library available from
* http://github.com/kristopher/PS2-Mouse-Arduino/
* Original by Kristopher Chambers <kristopher.chambers@gmail.com>
* Updated by Jonathan Oxer <jon@oxer.com.au>
*/
#include <PS2Mouse.h>
#define MOUSE_DATA 5
#define MOUSE_CLOCK 6
PS2Mouse mouse(MOUSE_CLOCK, MOUSE_DATA, STREAM);
/**
* Setup
*/
void setup()
{
Serial.begin(38400);
mouse.initialize();
}
/**
* Main program loop
*/
void loop()
{
int16_t data[3];
mouse.report(data);
Serial.print(data[0]); // Status Byte
Serial.print(":");
Serial.print(data[1]); // X Movement Data
Serial.print(",");
Serial.print(data[2]); // Y Movement Data
Serial.println();
}