User Tools

Site Tools


arduino:wio-en

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
arduino:wio-en [2019/10/09 14:15] – [RICi Throttle] rjversluisarduino:wio-en [2019/10/21 11:27] – [DCC Generator] rjversluis
Line 1: Line 1:
-====== W I O - WiFi Throttle - 32 I/O - LEDs - Servos ======+====== W I O - WiFi Throttle - 32I/O - LEDs - Servos - RFID - OLED - DCC ======
 [[:english|{{ :hardware.png}}]][[:english|{{ :rocrail-logo-35.png}}]] [[:english|{{ :hardware.png}}]][[:english|{{ :rocrail-logo-35.png}}]]
 [[:english|Content]] -> [[:hardware-en#arduino|Arduino]] [[:english|Content]] -> [[:hardware-en#arduino|Arduino]]
Line 10: Line 10:
 =====Introduction===== =====Introduction=====
 This solution is based on the LOLIN D1 Mini. (ESP8266)\\ This solution is based on the LOLIN D1 Mini. (ESP8266)\\
-It can be used as Throttle or 32 I/O with extra: LED control WS2812, or Four Servos, or 2 RC522 readers.\\+It can be used for: 
 +  - Wireless Throttle 
 +  - 32 I/O  
 +  - 2 Displays 
 +  - LED control WS2812 
 +  - Four Servos 
 +  - 2 RC522 readers 
 +  - DCC Generator
  
  \\  \\
Line 27: Line 34:
 ''LOLIN(WEMOS)D1 R2 & mini''\\ ''LOLIN(WEMOS)D1 R2 & mini''\\
 ====Libraries==== ====Libraries====
-  * ESP8266WiFi+  * ESP8266WiFi (Board Manager)
   * Wire   * Wire
   * FastLED   * FastLED
   * RotaryEncoder   * RotaryEncoder
-  * MFRC522+  * MFRC522 1.4.5
   * Servo   * Servo
  
Line 55: Line 62:
 Global variables use 33104 bytes (40%) of dynamic memory, leaving 48816 bytes for local variables. Maximum is 81920 bytes. Global variables use 33104 bytes (40%) of dynamic memory, leaving 48816 bytes for local variables. Maximum is 81920 bytes.
 </code> </code>
 +
 +^ Pratfall: Many Micro USB cables do only provide 5V and no data, and cannot be used to program. ^
  
  
Line 81: Line 90:
 steps=127 steps=127
 pulse=5 pulse=5
 +display=00
 RSSI=-62 RSSI=-62
  
Line 91: Line 101:
 *name=<Node name> *name=<Node name>
 *id=<Node number> *id=<Node number>
-*io=<type> <throttle> or <i2cled> or <i2cservo> or <i2crfid>+*io=<type> <throttle> or <i2cled> or <i2cservo> or <i2crfid> or <i2cdcc>
 *i2c=<oooooooobbbbbbbboooooooobbbbbbbb> o=output, i=input, b=block, p=pulse *i2c=<oooooooobbbbbbbboooooooobbbbbbbb> o=output, i=input, b=block, p=pulse
 *steps=<number of rotary steps> *steps=<number of rotary steps>
 *pulse=<output pulse length in 100ms units> *pulse=<output pulse length in 100ms units>
 +*display=<geometry> 0=96x16 1=128x32 2=128x64
 </code> </code>
  
Line 116: Line 127:
 | *steps=<value> | Number of rotary steps. | 127 | | *steps=<value> | Number of rotary steps. | 127 |
 | *pulse=<value> | Output pulse length in 100ms units. | 5 | | *pulse=<value> | Output pulse length in 100ms units. | 5 |
 +| *display=<value> | Default display geometry: 0=96x16 1=128x32 2=128x64 | 00 |
 **Note:**  Replace <value> to meet the local WiFi environment and setup.\\ **Note:**  Replace <value> to meet the local WiFi environment and setup.\\
  
 +===IO Type Configuration===
 +^ IO Type ^ I2C 32I/O ^ FastLED ^ Servo ^ RFID ^ Display ^ DCC ^
 +| throttle |  -  |  -  |  -  |  -  |  -  |  -  |
 +| i2cled |  YES  |  YES  |  NO  |  NO  |  YES  |  NO  |
 +| i2cservo |  YES  |  NO  |  YES  |  NO  |  YES  |  NO  |
 +| i2crfid |  YES  |  NO  |  NO  |  YES  |  YES  |  NO  |
 +| i2cdcc |  YES  |  NO  |  NO  |  NO  |  YES  |  YES  |
 +
 + \\
 =====RICi - Throttle===== =====RICi - Throttle=====
 **Note:** //RICi controls locos by address, not by ID. So the first one in the list will be used if multiple locos share the same address.//\\ **Note:** //RICi controls locos by address, not by ID. So the first one in the list will be used if multiple locos share the same address.//\\
Line 125: Line 146:
 ^ Pin ^ Usage ^ Click ^ Long click ^ ^ Pin ^ Usage ^ Click ^ Long click ^
 | D3 | Rotary A | - | - | | D3 | Rotary A | - | - |
-| D4 | LED | - | - | +| D4 | Onboard LED | - | - | 
 | D6 | Rotary B | - | - |  | D6 | Rotary B | - | - | 
 | D7 | Rotary switch | Change direction | Wait/Release loco | | D7 | Rotary switch | Change direction | Wait/Release loco |
Line 132: Line 153:
 | D2 | F3 | F3 | F7 | | D2 | F3 | F3 | F7 |
 | D5 | F4 | F4 | F8 | | D5 | F4 | F4 | F8 |
 +| A0 | Battery | - | - |
 ===Lights=== ===Lights===
 F0 is flipped if both F3 and F4 are pressed.\\  F0 is flipped if both F3 and F4 are pressed.\\ 
Line 273: Line 295:
  
  \\  \\
 +====Display SSD1306====
 +{{:arduino:wio-oled-128x32.jpg?400}}\\
 +Two displays can be connected to the I2C of Type SSD1306 with the I2C addresses 0x3C and 0x3D.\\
 +Formatted text is compatible with [[:rocnet:rocdisplay-en#text_format|RocDisplay]].\\
 +WIO supports only a subset, and some new lower case commands are introduced.\\
 +Code page is ISO 8859 Latin for font {F0}; {F1} is 7 bit ASCII only.\\
 +===Addressing===
 +The Bus is used for the WIO ID, and the Display number for selecting between 1 and 2. (0x3C or 0x3D)\\
 +The Address value is not used.\\
 +===Supported Formatting===
 +Formatting commands are enclose in curly brackets.
 +Example:
 +<code>
 +{g1}{E}{L0}{X0}Hello World!{P}
 +</code>
 +^ Command ^ Parameter ^ Description ^ Remark ^
 +| {Bn} | n=0-19 | Draw a bitmap on the current position. |
 +| {E} | - | Erase display buffer. An extra {P} is needed to erase the display. |
 +| {Fn} | n=0-1 | Select font. 0=normal 1=small |
 +| {Hn} | n=0-255 | Set the display contrast. |
 +| {In} | n=0-1 | Invert the display. 0=normal 1=inverted |
 +| {Ln} | n=0-3 | Goto line. The range depends on the display size. |
 +| {P} | - | Copy buffer to the display. |
 +| {Rn} | n=0,2 | Set display mapping rotation. 0=0° 2=180° |
 +| {?V} | - | Show firmware version. |
 +| {Xn} | n=0-127 | Goto column. The range depends on the display size. |
 +| {Yn} | n=0-32 | Goto row. The range depends on the display size. |
 +^ New command ^ Parameter ^ Description ^
 +| {cn} | n=0-16 | Draw an analog clock with the given radius on the current position. |
 +| {gn} | n=0,**1**,2 | Set display geometry. 0=96x16, 1=128x32, 2=128x64 (1 is default)| This is for testing only. To save CPU load set the [[#monitor_commands|display]] option. |
 +| {i} | - | Toggle inverted text. |
 +| {sn} | n=1-x | Draw scrolling text on the current position, with a view width of n characters. | Example: {s12}Scrolling text to show...{s} |
 +**Note:** //If the geometry is not default, 128x32, the text MUST start with a {gn} command for selecting the right geometry.//\\
 +
 +==Bitmaps==
 +The bitmaps are sized 20 x 8 pixel.
 +^ Number ^ Description ^
 +| 13 | Nederlandse Spoorwegen (NS) |
 + \\
 +
 +
 + \\
 +====DCC Generator====
 +The WIO supports following DCC packets: (WIP)
 +  * Loco speed and direction.
 +  * Loco functions 0-28.
 +===Features===
 +  * 100% NMRA timing conform.
 +  * Automatically Power OFF after a Rocrail Server connection loss.
 +===Pins DCC===
 +^ Pin ^ Usage ^
 +| D6 & D7 | DCC symmetric signal. |
 +===ORD3===
 +To use the 3.3V level a 470 Ohm resistor must be add parallel to R1.\\
 +===Mobile Addressing===
 +^ IID | WIO | Remark |
 +^ Bus | WIO ID |
 +^ Address | DCC decoder address. | Addresses > 99 are regarded as long DCC address. \\ Short addresses are not yet tested. |
 +^ Speed steps | 28 or 128 | 28 speed steps are not yet tested. |
 +
 +
 +
 + \\
 +
 =====Mobile===== =====Mobile=====
 The WIO can also be used as mobile RFID reader and I/O.\\ The WIO can also be used as mobile RFID reader and I/O.\\
arduino/wio-en.txt · Last modified: 2024/04/06 10:59 by rjversluis