Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tuenhidiy
tuenhidiy / Interactive_Test
Created December 26, 2017 09:09
Interactive RGB Led Table Test Program
void Interactive_Table()
{
if ( (unsigned long) (micros() - samplingtime) > 200 ) // Read 8 phototransistors every 200us
{
// Read 8 phototransistors every 200us and store data into array
phototransistor_data[0 + photo_adder] = analogRead(A0);
phototransistor_data[8 + photo_adder] = analogRead(A1);
phototransistor_data[16 + photo_adder] = analogRead(A2);
phototransistor_data[24 + photo_adder] = analogRead(A3);
phototransistor_data[32 + photo_adder] = analogRead(A4);
//************************************************************************************************************//
// The 8x8 Interactive RGB LED Table
//************************************************************************************************************//
#include <SPI.h>// SPI Library used to clock data out to the shift registers
#define latch_pin 4// Defines actual BIT of PortD for latch - is Arduino UNO pin 2, MEGA pin 4
#define blank_pin 5// Defines actual BIT of PortD for blank - is Arduino UNO pin 3, MEGA pin 5