//tips
//Biz
狩猟読本周回。
考える脚読了。
事業計画見直し。願望などを排除して短期のキャッシュポイントを再確認。
植松努さんのted視聴。熱い。
サーボタイマー
#include <Servo.h>
Servo myServo;
int servoDelay=1000;
int servoMax=180;
int servoMin=0;
int servoPos=0;
int timerSeconds=60;
void setup() {
// put your setup code here, to run once:
myServo.attach(9);
}
void loop() {
// put your main code here, to run repeatedly:
for(servoPos = servoMin;servoPos <= servoMax;servoPos += (servoMax/timerSeconds))
{
myServo.write(servoPos);
delay(servoDelay);
}
}
ソニックセンサー。
#include "SR04.h"
int trig_pin=12;
int echo_pin=11;
SR04 sensor = SR04(echo_pin,trig_pin);
long distance;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
delay(1000);
}
void loop() {
// put your main code here, to run repeatedly:
distance=sensor.Distance();
Serial.println(distance);
delay(1000);
}