This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Grove_Generic_PWM
Ten Wong edited this page Jun 8, 2016
·
3 revisions
The Grove Generic PWM can output a pwm signal whit specified frequency and duty. It also can be read for current state.
Read back the parameters of PWM.
Request method: GET
Returns:
HTTP 200 { "duty_percent": [float value],"freq": [uint32_t value] }
duty_percent: float value, 0.0~100.0, float number
freq: uint32_t value, unit: Hz
HTTP 400 {"error": "failure reason here"}
Curl example:
curl -k https://iot.seeed.cc/v1/node/GenericPWMOutD0/pwm
Response:
{"freq": 1000, "duty_percent": 50.0}
Output a PWM wave on specified IO. The default frequency is 1K Hz.
Request method: POST
Arguments in URL:
[duty_percent]: float value, 0.0~100.0, float number
Returns:
HTTP 200 {"result": "OK"}
HTTP 400 {"error": "failure reason here"}
Curl example:
curl -k -X POST https://iot.seeed.cc/v1/node/GenericPWMOutD0/pwm/20
Response:
{"result": "ok"}
Output a PWM wave on speicfied IO with specified frequency.
Request method: POST
Arguments in URL:
[duty_percent]: float value, 0.0~100.0, float number
[freq]: uint32_t value, unit: Hz
Returns:
HTTP 200 {"result": "OK"}
HTTP 400 {"error": "failure reason here"}
Curl example:
curl -k -X POST https://iot.seeed.cc/v1/node/GenericPWMOutD0/pwm_with_freq/20/2000
Response:
{"result": "ok"}