ESP8266 Camera Position Control
Posted: Sat Jul 23, 2016 11:41 pm
Version 1:
Software:
- Lua:
Hardware:
- ESP8266
- 5V USB power
- 3.3V Regulator
- 2x SG90 Servo, 5V for power, PWM directly from GPIO
Interaction:
- none
Version 2:
Software:
- Lua
Hardware:
- ESP8266
- 5V USB power
- 3.3V Regulator
- 2x SG90 Servo inside box, 5V for power, PWM directly from GPIO
- Pan/tilt servo mount, ebay inexpensive
Interaction:
- Move mouse pointer within rectangle
- mouse position x and y are scaled to 0-100 values and send to ESP via http request
- ESP lua web server scales values 0-100 to servo positions
Software:
- Lua:
Code: Select all
p0 = 4 pwm.setup(p0,50,70) pwm.start(p0)
p1 = 3 pwm.setup(p1,50,70) pwm.start(p1)
a0 = 30 d0 = 1 tmr.alarm(0, 13, 1, function() pwm.setduty(p0,a0) a0=a0+d0 if a0>125 or a0<30 then d0=d0*-1 a0=a0+d0 end end )
a1 = 70 d1 = 1 tmr.alarm(1, 17, 1, function() pwm.setduty(p1,a1) a1=a1+d1 if a1>125 or a1<30 then d1=d1*-1 a1=a1+d1 end end )
Hardware:
- ESP8266
- 5V USB power
- 3.3V Regulator
- 2x SG90 Servo, 5V for power, PWM directly from GPIO
Interaction:
- none
Version 2:
Software:
- Lua
Code: Select all
More sophisticated :)
Hardware:
- ESP8266
- 5V USB power
- 3.3V Regulator
- 2x SG90 Servo inside box, 5V for power, PWM directly from GPIO
- Pan/tilt servo mount, ebay inexpensive
Interaction:
- Move mouse pointer within rectangle
- mouse position x and y are scaled to 0-100 values and send to ESP via http request
- ESP lua web server scales values 0-100 to servo positions