Skip to content

Instantly share code, notes, and snippets.

//************************************************************************************************************//
// 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
@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
@tuenhidiy
tuenhidiy / bitmap.h
Created January 3, 2018 09:35
This Hex code show GIF picture.
#include <avr/pgmspace.h>
/*-----------------------------------------------------------------------------------------------
TIGER ANIMATION
-----------------------------------------------------------------------------------------------*/
static const uint8_t TIGER00[]PROGMEM = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
@tuenhidiy
tuenhidiy / BAM_32x32_BICOLOR_MATRIX
Last active January 3, 2018 17:17
Main program for 32x32 Bicolor Led Matrix using B.A.M - 4 bit method
//************************************************************************************************************//
//********************* THE 32x32 BICOLOR RG LED MATRIX USING BIT ANGLE MODULATION METHOD ********************//
//************************************************************************************************************//
#include <SPI.h>
#include "bitmap.h"
#define blank_pin 3 // Defines actual BIT of PortD for blank - is Arduino UNO pin 3, MEGA pin 5
#define latch_pin 2 // Defines actual BIT of PortD for latch - is Arduino UNO pin 2, MEGA pin 4
#include <Wire.h>
// MPU6050 Slave Device Address
const uint8_t MPU6050SlaveAddress = 0x68;
// Select SDA and SCL pins for I2C communication - Pin default in WIRE LIBRARY: SCL - D1 & SDA - D2 on NODEMCU
// const uint8_t SCL = D1;
// const uint8_t SDA = D2;
const int R = 14;
@tuenhidiy
tuenhidiy / WIRELESS LAMP CONTROL
Last active April 12, 2018 17:07
WIRELESS LAMP
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
const char* ssid = "FPT-Telecom";
const char* password = "tuenhidiy";
ESP8266WebServer server(80);
@tuenhidiy
tuenhidiy / Arduigames
Created April 29, 2018 08:42
Arduigames use Arduino Uno, LoLShield, MPU6050 & Microphone Module to play some simple games & animations
#include "Charliplexing.h" //LOL library
#include "Myfont.h"
#include "Figure.h"
#include "Font.h"
#include "Arduino.h"
#include "fix_fft.h"
#include "LOLDraw.h"
#include "LoLShield_Tetris.h"
#include <Wire.h>//gyro
@tuenhidiy
tuenhidiy / Two_Wheel_Self_Balance_Robot
Last active July 18, 2018 15:53
This is main program for 2 wheel self balancing robot.
/*******************************************************************************************
* Two Wheel Self Balancing Robot
*
* REVISION
* ________________________________________________________________________________________
*
* It is referred from many sources.
* - I2Cdev library: https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/I2Cdev
* - MPU6050 library: http://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050
#include <SPI.h>
//*************************************************ARDUINO PIN USAGE***********************************************//
#define latch_pin 2
#define blank_pin 4
#define data_pin 11
#define clock_pin 13
//*************************************************COLORWHEEL VARIABLES***********************************************//