int dqvPin = 5; //读取环境光线强度
int LED = 13; //定义LED接口 D13
int val = 0; //定义光线强度变量值
void setup() {
pinMode(LED,OUTPUT); //设置D13为输出模式
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}
void loop() {
val = analogRead(dqvPin); //读取环境光线强度值
Serial.println(val);
delay(10)
/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
for(pos = 0; pos <= 75; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 75; pos>=0; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
long_.ino:9:1: error: stray '\' in program
long_.ino:9:1: error: stray '\' in program
long_.ino:11:9: error: stray '\' in program
long_.ino:11:9: error: stray '\' in program
long_.ino:11:9: error: stray '\' in program
long_.ino:12:9: error: stray '\' in program
long_.ino:12:9: error: stray '\' in program
long_.ino:14:1: error: stray '\' in program
long_.ino:14:1: error: stray '\' in program
long_.ino:16:9: error: stray '\' in program
long_.ino:16:9: error: stray '\' in program
long_.ino:17:9: error: stray '\' in program
long_.ino:17:9: error: stray '\' in program
long_.ino:18:5: error: stray '\' in program
long_.ino:18:5: error: stray '\' in program
long_.ino:21:9: error: stray '\' in program
long_.ino:21:9: error: stray '\' in program
long_.ino:23:9: error: stray '\' in program
long_.ino:23:9: error: stray '\' in program
long_.ino:23:9: error: stray '\' in program
long_.ino:24:9: error: stray '\' in program
long_.ino:24:9: error: stray '\' in program
long_.ino:28:10: error: stray '\' in program
long_.ino:28:10: error: stray '\' in program
long_.ino:28:10: error: stray '\' in program
long_.ino:33:1: error: stray '\' in program
long_.ino:33:1: error: stray '\' in program
long_.ino:35:3: error: stray '\' in program
long_.ino:35:3: error: stray '\' in program
long_.ino:37:5: error: stray '\' in program
long_.ino:37:5: error: stray '\' in program
long_.ino:37:5: error: stray '\' in program
long_.ino:37:5: error: stray '\' in program
long_.ino:37:5: error: stray '\' in program
long_.ino:38:5: error: stray '\' in program
long_.ino:38:5: error: stray '\' in program
long_.ino:38:5: error: stray '\' in program
long_.ino:38:5: error: stray '\' in program
long_.ino:39:5: error: invalid suffix "ms" on integer constant
long_.ino:40:3: error: stray '\' in program
long_.ino:40:3: error: stray '\' in program
long_.ino:42:5: error: stray '\' in program
long_.ino:42:5: error: stray '\' in program
long_.ino:43:5: error: stray '\' in program
long_.ino:43:5: error: stray '\' in program
long_.ino:43:5: error: stray '\' in program
long_.ino:43:5: error: stray '\' in program
long_.ino:9:12: error: expected initializer before 'uff08'
long_.ino:14:11: error: expected initializer before 'uff08'
编译有误。