Skip to content

rl337/Arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Arduino

Arduino related code.

SmoothAnalogInput -- Smooths out analog input over some specified number of samples.

example:

Servo servo; SmoothAnalogInput ai; int last; void setup() { Serial.begin(9600); servo.attach(7); ai.attach(A0); last = -1; }

void loop() { int sensorReading = ai.read();

int scaled = map(sensorReading, 0, 1024, 0, 180); if (scaled != last) { last = scaled; Serial.println(scaled); servo.write(scaled); } }

About

Arduino related code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages