Skip to content
Snippets Groups Projects
Commit db7b7a8a authored by Ricco Müller's avatar Ricco Müller
Browse files

Upload New File

parent ed6af3d9
No related branches found
No related tags found
No related merge requests found
#include <ADNS3080.h>
// SPI pins:
#define PIN_RESET 22
#define PIN_CS 5
ADNS3080<PIN_RESET, PIN_CS> sensor;
// Serial parameters: [Must match python script]
#define BEGIN_CHAR 'A'
#define BAUD_RATE 57600
void setup() {
// Initialize sensor
sensor.setup( false, false );
// Set baud rate
Serial.begin(BAUD_RATE);
// Prevent random character
Serial.flush();
// Indicate new frame
Serial.println( BEGIN_CHAR );
}
void loop() {
// Get frame data
uint8_t frame[ADNS3080_PIXELS][ADNS3080_PIXELS];
sensor.frameCapture( frame );
// Scan grid and send pixel color
for( int y = 0; y < ADNS3080_PIXELS; y += 1 ) {
for( int x = 0; x < ADNS3080_PIXELS; x += 1 ) {
Serial.println( frame[x][y] );
}
}
// Indicate new frame
Serial.println( BEGIN_CHAR );
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment