This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (col = 0; col < 8; col++) | |
{ | |
switch (col % 2) | |
{ | |
case 0:// "even" col | |
for (int row = 0 + repeat; row < 8 + repeat; row++) | |
{ | |
switch (repeat) | |
{ | |
.....//something doing here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*skip those varible which i initailized*/ | |
void loop() | |
{ | |
timeTracing(); | |
} | |
void transmit(byte addr, byte something) | |
{ | |
Wire.beginTransmission(addr); | |
Wire.write(something); | |
Wire.endTransmission(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned int number[10][8][9] = {/*...is the number i set up in advance*/}; | |
void loop() | |
{ | |
byte which_number = Wire.read();// the number | |
switch (which_number) | |
{ | |
case 0:// number 0 | |
for (byte x = 0; x < 8; x++) | |
{ | |
for (byte y = 0; y < 8; y++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void loop() | |
{ | |
transmit(0x09, 255); | |
delay(1000); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
byte received[8][8]; //build an empty array to store the byte received from master | |
void setup() { | |
Serial.begin(57600); | |
Serial.println("test"); | |
Wire.begin(0x09); | |
Wire.onReceive(receiveEvent);// this function will be triggered whenever something received | |
} | |
void loop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
const char* ssid = "...";// type in the SSID name which you want to connect | |
const char* password = "...";// type the password of the WiFi AP you choose | |
void setup() { | |
Serial.begin(115200); | |
delay(10); | |
// Connect to WiFi network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
const char* ssid = "...";// type in the SSID name which you want to connect | |
const char* password = "...";// type the password of the WiFi AP you choose | |
WiFiServer server(80);// ESP8266 server | |
void setup() { | |
Serial.begin(115200); | |
delay(10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define pinNUM 5 | |
int location[5] = {2, 3, 4, 5, 6}; | |
unsigned long triggerTime; | |
unsigned long lastTriggerTime[pinNUM] = {}; | |
void setup() | |
{ | |
for (int i = 0; i < 5; i++) | |
{ | |
pinMode(location[i], OUTPUT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <IRremoteESP8266.h> | |
const int RECV_PIN = 13; | |
const int R_FD = 2; | |
const int R_BD = 16; | |
const int L_FD = 4; | |
const int L_BD = 5; | |
IRrecv irrecv(RECV_PIN); |
OlderNewer