User Tools

Site Tools


en-us_commands:reference:isegwrite

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en-us_commands:reference:isegwrite [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1en-us_commands:reference:isegwrite [2026/09/08 00:53] (current) – 바깥 편집 127.0.0.1
Line 16: Line 16:
  
 <code cpp> <code cpp>
-uint8_t data[4] { +const uint8_t CLK_PIN 14; 
-  IsegEncodeDigit(1), +const uint8_t DIO_PIN = 15;
-  IsegEncodeDigit(2), +
-  IsegEncodeDigit(3), +
-  0x3E                    // V: F,E,D,C,B +
-};+
  
-IsegWrite(data);+void setup() { 
 +  IsegBegin(CLK_PIN, DIO_PIN, 100, 0);  // Set the CLK/DIO pins and device number of the TM1637 FND. 
 +  IsegBrightness(5, true, 0);  // Set display brightness and on/off state. 
 +
 + 
 +void loop() { 
 +  const uint16_t value = analogRead(A0);  // Read the raw analog value of the specified channel. 
 +  uint8_t digits[4] = { 
 +    IsegEncodeDigit((value / 1000) % 10),  // Convert one digit to segment data. 
 +    IsegEncodeDigit((value / 100) % 10),  // Convert one digit to segment data. 
 +    IsegEncodeDigit((value / 10) % 10),  // Convert one digit to segment data. 
 +    IsegEncodeDigit(value % 10)  // Convert one digit to segment data. 
 +  }; 
 +  IsegWrite(digits, 4, 0, 0);  // Output segment data at the specified position. 
 +  delay(100); 
 +}
 </code> </code>
  
Line 35: Line 46:
   * Do not use the specified pins simultaneously for UART, PWM, encoders, external interrupts or other functions.   * Do not use the specified pins simultaneously for UART, PWM, encoders, external interrupts or other functions.
   * Check the actual module and product manuals for FND power and signal voltages.   * Check the actual module and product manuals for FND power and signal voltages.
 +
 +===== Built-in Commands in the Same Category =====
 +
 +  * [[:en-us_commands:reference:isegbegin|IsegBegin() View detailed description]]
 +  * [[:en-us_commands:reference:isegbrightness|IsegBrightness() View detailed description]]
 +  * [[:en-us_commands:reference:isegclear|IsegClear() View detailed description]]
 +  * [[:en-us_commands:reference:isegdecimal|IsegDecimal() View detailed description]]
 +  * [[:en-us_commands:reference:iseghex|IsegHex() View detailed description]]
 +  * [[:en-us_commands:reference:isegencodedigit|IsegEncodeDigit() View detailed description]]
  
 [[:en-us_commands:builtin|← Built-in Command List]] [[:en-us_commands:builtin|← Built-in Command List]]
  
en-us_commands/reference/isegwrite.1788785568.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki