/arduino_snippets

Arduino related stuff

Primary LanguageC++GNU General Public License v3.0GPL-3.0

Arduino Snippets

Arduino related stuff

servo_custom_scale

Implements a function to move a servo on a defined angle range using a custom scale

int move_servo(Servo servo,float min_angle,float max_angle, float min_val, float max_val, float value, bool reverse)

arguments

  • servo: a Servo instance (see Servo.h)
  • min_angle: minimum servo angle
  • max_angle: maximum servo angle
  • min_val: minimum value on the custom scale
  • max_val: maximum value on the custom scale
  • value: value on the custom scale to move the servo to
  • reverse: reverse movement

TM1637Display_distance_SR04

Display a distance detected with SR04 sonar on a TM1637 display.

median

Calculate a median from an array of values in Arduino.

eeprom

Write and read values from Arduino eeprom.