DFRobot DFR0274 Schnellstart-Handbuch - Seite 6

Blättern Sie online oder laden Sie pdf Schnellstart-Handbuch für Mikrocontroller DFRobot DFR0274 herunter. DFRobot DFR0274 12 Seiten. Rgb led strip driver shield

DFRobot DFR0274 Schnellstart-Handbuch
changed the original program to use on IR Kit For Arduino Model: DFR0107
32 bit controller.
All keypresses are sent to the serial monitor at 9600 baud.
pulseIn is always HIGH. The phototransistor in the kit does not invert the
signal.
uses pin 13 for heartbeat debug
32 bits requires a long variable, so divided up into two 15 bit so can use
integer variables
use the first 15 bits of the 32 bits for remote and data stream
verification. This code is always the same for every button press
use the last 15 of the 32 bits for button press selection. This code
changes for each button.
ignore the middle 2 bits, it never changes.
*/
#define IR_BIT_LENGTH 32
#define FirstLastBit 15
integer variables. Ignore center two bits. they are all the same.
#define BIT_1 1500
#define BIT_0 450
#define BIT_START 4000
#define IR_PIN 4
#define LED_PIN 13
int debug = 0;
length in microseconds
int output_verify = 0;
integers. same number for all buttons
int output_key = 0;
int remote_verify = 16128;
different remotes may have different start codes
int Blue_Bright=0;
int Red_Bright=0;
int Green_Bright=0;
int RedPin = 10;
int GreenPin = 11;
int BluePin = 9;
boolean Blue_flag=false;
boolean Red_flag=false;
boolean Green_flag=false;
boolean Flash_flag=false;
void setColor(int red, int green, int blue)
{
analogWrite(RedPin, red);
analogWrite(GreenPin, green);
analogWrite(BluePin, blue);
}
void setup()
{
pinMode(LED_PIN, OUTPUT); //This shows when ready to recieve
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
// number of bits sent by IR remote
// divide 32 bits into two 15 bit chunks for
// Binary 1 threshold (Microseconds)
// Binary 0 threshold (Microseconds)
// Start bit threshold (Microseconds)
// IR Sensor pin
// LED goes off when signal is received
// flag as 1 to output raw IR pulse data stream
// flag as 1 to print decoded verification
// flag as 1 to print decoded key integers
// verifies first bits are 11111100000000