e_drone for python / Examples / Vibrator

Modified : 2021.1.4



sendVibrator 함수 테스트

from time import sleep

from e_drone.drone import *
from e_drone.protocol import *


if __name__ == '__main__':

    drone = Drone()
    drone.open()

    drone.sendVibrator(100, 200, 1200)
    sleep(1)

    drone.close()



Vibrator 클래스 데이터를 직접 채워서 전송하기

from time import sleep

from e_drone.drone import *
from e_drone.protocol import *


if __name__ == '__main__':

    drone = Drone()
    drone.open()


    header = Header()
    
    header.dataType = DataType.Vibrator
    header.length   = Vibrator.getSize()
    header.from_    = DeviceType.Tester
    header.to_      = DeviceType.Controller

    data = Vibrator()

    data.mode       = VibratorMode.Instantally
    data.on         = 100
    data.off        = 200
    data.total      = 1200

    drone.transfer(header, data)
    sleep(1)


    drone.close()



e_drone for python

  1. Intro
  2. Command Line
  3. System
  4. Protocol
  5. Drone
  6. Examples - Ping
  7. Examples - Information
  8. Examples - Pairing
  9. Examples - Control
  10. Examples - Sensor
  11. Examples - Motor
  12. Examples - Setup
  13. Examples - Buzzer
  14. Examples - Vibrator
  15. Examples - Light
  16. Examples - Display
  17. Examples - Input
  18. Examples - Error


Index