advertisement

2015年7月25日

test 7

/*
  ReadAnalogVoltage
  Reads an analog input on pin 0, converts it to voltage, and prints the result to the serial monitor.
  Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

 This example code is in the public domain.
 */
const int ledPin =  13;      // the number of the LED pin

// Variables will change:
int ledState = LOW;             // ledState used to set the LED
long previousMillis = 0,abcMillis=0;        // will store last time LED was updated
unsigned long button=0;
int buttonflag=1;
int count=0,longflag=0;

2015年7月24日

Arduino practice 3

const int numReadings = 10;

int readings[numReadings];      // the readings from the analog input
int index = 0;                  // the index of the current reading
int total = 0;                  // the running total
int average = 0;                // the average
int brightness = 0;
int fadeAmount = 5;
int delayDuration = 30;
int flag=0;