사용자 도구

사이트 도구


commands:analog_output_pwm

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판이전 판
다음 판
이전 판
commands:analog_output_pwm [2026/08/31 22:52] – 바깥 편집 127.0.0.1commands:analog_output_pwm [2026/09/12 23:27] (현재) – 바깥 편집 127.0.0.1
줄 1: 줄 1:
-====== 아날로그 출력과 PWM ======+====== 아날로그 출력·PWM ======
  
-^ 명령어 ^ 설명 ^ +출력 방식에 맞는 초기화·값 변환·PWM 명령어를 선택합니다. 지원 채널은 제품별 사양을 확인하십시오.
-| ''analogWriteInit(ch, top, prescaler)''출력 타이머의 분해능과 분주비를 설정합니다. | +
-| ''analogWriteFreq(ch, hz)'', ''analogWriteMax(ch)'' | 주파수를 설정하거나 최댓값을 확인합니다. | +
-| ''IanalogWriteInit(ch, max, min, mode)'' | MPAINO 아날로그 출력 범위를 초기화합니다. | +
-| ''IanalogWrite(ch, min, max, value)'', ''IanalogWritef(...)'' | 사용자을 출력 범위로 변환합니다. | +
-| ''analogWrite2(ch, value)'', ''IanalogWrite2(...)'' | 4~20mA 출력을 변환합니다. | +
-| ''PWM(pin, value, bit16)'' | 8비트 또는 16비트 PWM을 출력합니다. | +
-| ''FDPWM(pin, hz, duty)'' | 주파수와 Duty를 지정합니다. +
-| ''NPWM_BEGIN(pin, hz, duty, count)'', ''NPWM(pin)''정 개수의 펄스를 출력합니다. | +
-| ''PWMOFF(pin, off)'', ''PWM_RESET()'' | 개별 또는 전체 PWM을 정지합니다|+
  
-<code cpp> +===== 아날로그 출력 =====
-void setup() { +
-  IanalogWriteInit(0, 65535, 0, false); +
-+
-void loop() { +
-  IanalogWritef(0, 0.0, 100.0, 50.0); +
-+
-</code>+
  
-===== 명령어 원형 =====+  * [[commands:reference:analogwriteinit|analogWriteInit()]] — 출력 타이머의 분해능과 분주비를 설정합니다. 
 +  * [[commands:reference:analogwritefreq|analogWriteFreq()]] — 지정한 출력 채널의 PWM 주파수를 설정합니다. 
 +  * [[commands:reference:analogwritemax|analogWriteMax()]] — 지정한 출력 채널에서 사용할 수 있는 최댓값을 반환합니다. 
 +  * [[commands:reference:ianalogwriteinit|IanalogWriteInit()]] — MPAINO 아날로그 출력의 최댓값·최솟값과 모드를 설정합니다. 
 +  * [[commands:reference:ianalogwrite|IanalogWrite()]] — 사용자 정수값을 아날로그 출력 범위로 변환하여 출력합니다. 
 +  * [[commands:reference:ianalogwritef|IanalogWritef()]] — 사용자 실수값을 아날로그 출력 범위로 변환하여 출력합니다.
  
-^ 반환형 ^ 명령어 원형 ^ +===== 4~20mA 출력 =====
-| ''void'' | ''analogWriteInit(uint8_t ch, uint16_t top 65535, uint16_t prescaler 1)''+
-| ''uint16_t'' | ''analogWriteFreq(uint8_t ch, uint32_t frequencyHz)''+
-| ''uint16_t'' | ''analogWriteMax(uint8_t ch)''+
-| ''void'' | ''IanalogWriteInit(uint8_t ch, uint32_t maxValue 65535UL, uint32_t minValue 0, bool mode false)''+
-| ''void'' | ''IanalogWrite(uint8_t ch, int32_t min, int32_t max, int32_t value)''+
-| ''void'' | ''IanalogWritef(uint8_t ch, float min, float max, float value)''+
-| ''void'' | ''analogWrite2(uint8_t ch, uint16_t value)''+
-| ''void'' | ''IanalogWrite2(uint8_t ch, int32_t min, int32_t max, int32_t value)''+
-| ''void'' | ''IanalogWrite2f(uint8_t ch, float min, float max, float value)''+
-| ''void'' | ''PWM(uint8_t pin, uint16_t val, bool onDutybit16 false)''+
-| ''void'' | ''FDPWM(uint8_t pin, int32_t intHz, float Duty)''+
-| ''void'' | ''PWM_RESET()''+
-| ''void'' | ''NPWM_BEGIN(uint8_t pin, uint32_t intHz, float Duty, uint32_t N)''+
-| ''void'' | ''NPWM(uint8_t pin)''+
-| ''void'' | ''PWMOFF(uint8_t pin, bool POff)'' |+
  
-출력 채널의 전압·전류 모드와 하 배선을 먼저 확인. PWM, 고속펄스, ''analogWrite()''와 콜백 타이머는 하드웨어 타이머를 공유할 수 있습니다.+  * [[commands:reference:analogwrite2|analogWrite2()]] — 지정한 채널에 4~20mA 변환용 원시값을 출력합니다. 
 +  * [[commands:reference:ianalogwrite2|IanalogWrite2()]] — 사용자 정수값을 4~20mA 출력 범위로 변환합니다. 
 +  * [[commands:reference:ianalogwrite2f|IanalogWrite2f()]] — 사용자 실수값을 4~20mA 출력 범위로 변환합니다. 
 + 
 +===== PWM 출력 ===== 
 + 
 +  * [[commands:reference:pwm|PWM()]] — 지정한 핀에 8비트 또는 16비트 PWM을 출력합니다. 
 +  * [[commands:reference:fdpwm|FDPWM()]] — 주파수와 Duty 비율을 지정여 PWM을 출력합니다. 
 +  * [[commands:reference:pwmoff|PWMOFF()]] — 지정한 핀의 PWM 출력을 정지거나 다시 허용합니다. 
 +  * [[commands:reference:pwm_reset|PWM_RESET()]] — 코어가 관리하는 PWM 상태를 모두 초기화합니다. 
 + 
 +===== 펄스 출력 ===== 
 + 
 +  * [[commands:reference:npwm_begin|NPWM_BEGIN()]] — 주파수·Duty·출력 개수를 지정하여 펄스 출력을 준비합니다. 
 +  * [[commands:reference:npwm|NPWM()]] — 준비한 개만큼 펄스를 출력합니다.
  
 [[commands:builtin|← 내장 명령어 리스트]] [[commands:builtin|← 내장 명령어 리스트]]
  
commands/analog_output_pwm.1788184327.txt.gz · 마지막으로 수정됨: 저자 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki