arduino:wio-en
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
arduino:wio-en [2021/09/07 22:12] – [WIO Sketch] rjversluis | arduino:wio-en [2024/04/18 11:53] (current) – [LEDs] rjversluis | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | [[: | ||
[[: | [[: | ||
====== WIO Firmware ====== | ====== WIO Firmware ====== | ||
- | [[:english|{{ :hardware.png}}]][[:english|{{ : | + | [[:wio: |
- | [[: | + | [[: |
- | * [[: | + | * [[: |
* [[: | * [[: | ||
+ | * [[https:// | ||
\\ | \\ | ||
=====Introduction===== | =====Introduction===== | ||
- | This solution | + | This project |
+ | The source code is only available to be able to flash it on the target device if no other method is possible.\\ | ||
+ | Forking or manipulating the source code is NOT allowed and is protected by copyright.\\ | ||
It can be used as: | It can be used as: | ||
Line 29: | Line 33: | ||
* Lolin D32 | * Lolin D32 | ||
* ESP32 Dev Module | * ESP32 Dev Module | ||
- | * ESP32 CAM Module | + | * ESP32 D1 Mini |
- | ====Used | + | ====Used Pins==== |
Check the pin mapping in Pins.cpp: | Check the pin mapping in Pins.cpp: | ||
* https:// | * https:// | ||
====Flyer==== | ====Flyer==== | ||
- | * https:// | + | * https:// |
\\ | \\ | ||
Line 50: | Line 54: | ||
\\ | \\ | ||
- | =====Arduino IDE 1.8.13===== | + | =====Arduino IDE===== |
Prepare the Arduino IDE with the following boards and libraries: | Prepare the Arduino IDE with the following boards and libraries: | ||
- | ====Board manager===== | + | ====Boards Manager===== |
- | Add in the preference dialog to " | + | Add in the preference dialog to " |
< | < | ||
- | https:// | + | https:// |
+ | https://raw.githubusercontent.com/espressif/ | ||
</ | </ | ||
+ | |||
{{ : | {{ : | ||
- | And install the ESP8266 | + | And install the ESP8266 |
====Board selection==== | ====Board selection==== | ||
{{ : | {{ : | ||
Line 66: | Line 72: | ||
===ESP8266 & ESP32=== | ===ESP8266 & ESP32=== | ||
* ESP8266 (Board Manager) | * ESP8266 (Board Manager) | ||
- | * Wire (I2C) | + | * Adafruit NeoPixel |
- | * FastLED | + | |
* RotaryEncoder | * RotaryEncoder | ||
* MFRC522 (RC522) | * MFRC522 (RC522) | ||
* Servo | * Servo | ||
* ArduinoOTA | * ArduinoOTA | ||
- | * MCP_CAN | + | * mcp_can |
* https:// | * https:// | ||
* [[: | * [[: | ||
+ | * SparkFun APDS9960 RGB and Gesture Sensor \\ Line 198 in the Arduino/ | ||
+ | |||
+ | |||
===ESP32=== | ===ESP32=== | ||
* ESP32 (Board Manager) | * ESP32 (Board Manager) | ||
Line 94: | Line 102: | ||
// wait for the frame tx to complete | // wait for the frame tx to complete | ||
- | int rc = xSemaphoreTake(sem_tx_complete, | + | int rc = xSemaphoreTake(sem_tx_complete, |
return rc; | return rc; | ||
} | } | ||
Line 102: | Line 110: | ||
\\ | \\ | ||
- | ====SPIFFS==== | + | ====FileSystem==== |
- | Select | + | Select |
- | {{:arduino:arduino-esp8266-spiffs-2m.png?400}}\\ | + | {{: |
- | SPIFFS | + | LittleFS |
Installing the Arduino IDE Plugin for uploading data: | Installing the Arduino IDE Plugin for uploading data: | ||
* https:// | * https:// | ||
- | ====Dark Theme==== | ||
- | For those who wants a Dark Theme for the Arduino IDE: | ||
- | * https:// | ||
- | \\ | ||
=====WIO Sketch===== | =====WIO Sketch===== | ||
- | | //Copyright (c) 2002-2021 Robert Jan Versluis, Rocrail.net// | + | | //Copyright (c) 2002-2022 Robert Jan Versluis, Rocrail.net// |
WIO is firmware for controlling Throttle, I2C, LEDs, Servos, RFID, Displays and DCC.\\ | WIO is firmware for controlling Throttle, I2C, LEDs, Servos, RFID, Displays and DCC.\\ | ||
* [[https:// | * [[https:// | ||
Line 122: | Line 126: | ||
The source code is public but not open source licensed, and it should be used only to compile and load it on the LOLIN D1 Mini or D32.\\ | The source code is public but not open source licensed, and it should be used only to compile and load it on the LOLIN D1 Mini or D32.\\ | ||
- | ====IMPORTANT==== | + | |
+ | __**IMPORTANT**__ | ||
^ :!::!::!: The directory MUST be renamed after unpacking the ZIP from " | ^ :!::!::!: The directory MUST be renamed after unpacking the ZIP from " | ||
The sources are unusable in the Arduino IDE without renaming the main source directory, and will bring only a mess of compile errors!\\ | The sources are unusable in the Arduino IDE without renaming the main source directory, and will bring only a mess of compile errors!\\ | ||
- | \\ | + | \\ |
+ | (**Important: | ||
+ | \\ | ||
+ | \\ | ||
====Binary==== | ====Binary==== | ||
- | {{ : | + | {{ : |
Use the Espressif tool to upload the WIO Binary. | Use the Espressif tool to upload the WIO Binary. | ||
* [[https:// | * [[https:// | ||
Line 159: | Line 167: | ||
< | < | ||
------------------------------ | ------------------------------ | ||
- | revision=261 WIO 20200812a | + | revision=458 WIO (c)Rocrail |
+ | 192.168.100.175 RSSI=-52 | ||
+ | battery=186 | ||
+ | EEPROM size=3804 | ||
+ | Free heap=174271 | ||
+ | I/O state=00 00 00 00 | ||
------------------------------ | ------------------------------ | ||
- | Settings: | + | SPIFFS total=1345kb used=0kb |
+ | file: Disco01.led size=110 | ||
+ | ------------------------------ | ||
+ | Configuration: | ||
------------------------------ | ------------------------------ | ||
ssid1= | ssid1= | ||
Line 168: | Line 184: | ||
pwd2= | pwd2= | ||
server= | server= | ||
- | port=8051 | + | name=[local] |
- | name=[wio104] | + | id=45 |
- | id=104 | + | io=i2cled |
- | io=i2cdcc (master) | + | i2c=ooooooooiiiiiiii |
- | iostate=00 00 00 00 | + | |
- | i2c=oooooooobbbbbbbboooooooobbbbbbbb | + | |
steps=64 | steps=64 | ||
sleeptimer=5 | sleeptimer=5 | ||
pulse=5 | pulse=5 | ||
pwmsize=0 | pwmsize=0 | ||
- | options=0x00 0x01 0x18 | + | options=0xC2 0x01 0x00 0x00 |
booster=0 | booster=0 | ||
board=1 | board=1 | ||
- | display=0 | + | display=3 |
railcom=0 | railcom=0 | ||
id12=0 | id12=0 | ||
depart=0 | depart=0 | ||
- | stepper=0 stepper3w=0 | + | stepper=0 |
- | canprot=1(1) | + | canprot=0(0) |
- | canio=1 | + | canio=0 |
canusb=0 | canusb=0 | ||
trace=0 | trace=0 | ||
- | SPIFFS total=1345kb used=0kb | ||
- | |||
- | Change settings by typing: | ||
------------------------------ | ------------------------------ | ||
- | *ssid=< | ||
- | *pwd=< | ||
- | *server=< | ||
- | *port=< | ||
- | *name=< | ||
- | *id=< | ||
- | *io=< | ||
- | *i2c=< | ||
- | *steps=< | ||
- | *pulse=< | ||
- | *pwm=< | ||
- | *boost=< | ||
- | *dccslave=< | ||
- | *board=< | ||
- | *display=< | ||
- | *trace=< | ||
- | *canprot=< | ||
- | *canio=< | ||
- | |||
</ | </ | ||
Line 227: | Line 219: | ||
- If RailCom has been activated the baudrate switches automatically to 250000 and the Serial Monitor is read only. | - If RailCom has been activated the baudrate switches automatically to 250000 and the Serial Monitor is read only. | ||
- If ID12 has been activated the baudrate switches automatically to 9600 and the Serial Monitor is read only. | - If ID12 has been activated the baudrate switches automatically to 9600 and the Serial Monitor is read only. | ||
+ | |||
+ | Basic connection setup can also be done on the __**[[: | ||
^ Command ^ Description ^ Default ^ Remark ^ | ^ Command ^ Description ^ Default ^ Remark ^ | ||
| ? | Shows the current settings and how to change them. | | | ? | Shows the current settings and how to change them. | | ||
| ! | Dumps the used Flash memory. | | | ! | Dumps the used Flash memory. | | ||
- | | *ssid=< | + | | *sod | Force Start of Day | |
- | | *pwd=< | + | | *scan | List all available WiFi APs | |
+ | | *ssid1=< | ||
+ | | *pwd1=< | ||
| *ssid2=< | | *ssid2=< | ||
| *pwd2=< | | *pwd2=< | ||
- | | *server=< | + | | *server=< |
- | | *port=< | + | | *autoserver=< |
| *name=< | | *name=< | ||
| *id=< | | *id=< | ||
Line 245: | Line 241: | ||
| *canprot=< | | *canprot=< | ||
| *dccslave=< | | *dccslave=< | ||
- | | *trace=< | + | | *trace=< |
| *ptmain=< | | *ptmain=< | ||
| *pwm=< | | *pwm=< | ||
Line 272: | Line 268: | ||
- | ====Basic Setup with WEB Browser==== | + | |
- | | //Not activated in case of DCC WIO type.// | + | |
- | The WIO acts as a tiny Access Point to be able to connect and do the basic setup without serial monitor.\\ | + | |
- | The WIO AP name is formatted as follows: " | + | |
- | The WIO APs are listed up and can be selected: | + | |
- | {{: | + | |
- | The AP default **Password** is " | + | |
- | After connecting to the WIO, the basic setup can be changed with a WEB browser at URL: | + | |
- | < | + | |
- | http:// | + | |
- | </ | + | |
- | After **Submit** the WIO will retry automatically the WiFi and Rocrail Server connection.\\ | + | |
- | The AP will be stopped after: | + | |
- | * a submit. | + | |
- | * 2 minutes idle. | + | |
- | \\ | + | |
====OTA Updating==== | ====OTA Updating==== | ||
| //Must be activated by WIO Dialog.// | | //Must be activated by WIO Dialog.// | ||
Line 299: | Line 280: | ||
\\ | \\ | ||
+ | ====OTA Install from scratch==== | ||
+ | * __**[[arduino: | ||
=====RIC - Throttle===== | =====RIC - Throttle===== | ||
| Note: RIC is no longer supported in the firmware, and is replaced by [[: | | Note: RIC is no longer supported in the firmware, and is replaced by [[: | ||
Line 360: | Line 343: | ||
* Connects directly to the Rocrail Server Client port 8051. | * Connects directly to the Rocrail Server Client port 8051. | ||
* WiFi and Server connection recovery. | * WiFi and Server connection recovery. | ||
- | * 32 digital I/O compatible with all GCA interfaces. | + | * 32 digital I/O, MCP23017, |
* Input | * Input | ||
* Output | * Output | ||
Line 380: | Line 363: | ||
* Input events must be acknowledged within 100ms. After this timeout a resend will occur. (Max. 5 retries.) | * Input events must be acknowledged within 100ms. After this timeout a resend will occur. (Max. 5 retries.) | ||
- | \\ | + | |
+ | ====I/O Extender PCF8574P==== | ||
+ | Up to 4 pieces of I/O extender type PCF8574 can be used as alternative to the 2 pieces of MCP23017. | ||
+ | - 0x20 and 0x21 should not be available as I2C slave ID's. (No MCP23017' | ||
+ | - The slave ID's of the PCF8574 should start with 0x22. | ||
+ | |||
+ | **Note:** //Check for the correct type to match the 0x20 base address: PCF8574P or PCF857T. (The PCF8574A type starts with base address 0x38.)// | ||
+ | \\ | ||
====Addressing==== | ====Addressing==== | ||
|< >| | |< >| | ||
Line 399: | Line 389: | ||
The next address for none single gate switches is used for the turnout command.\\ | The next address for none single gate switches is used for the turnout command.\\ | ||
So if on port 1 is a dual coil switch, port 2 should not be used, and the second switch goes on port 3.\\ | So if on port 1 is a dual coil switch, port 2 should not be used, and the second switch goes on port 3.\\ | ||
- | Both I2C outputs | + | Both I2C outputs |
Possible hardware: | Possible hardware: | ||
* **[[: | * **[[: | ||
Line 410: | Line 400: | ||
\\ | \\ | ||
====LEDs==== | ====LEDs==== | ||
+ | //" | ||
{{ : | {{ : | ||
The addressing is the same as normal outputs.\\ | The addressing is the same as normal outputs.\\ | ||
+ | |||
+ | **Dimming information: | ||
+ | //WIO version 875+//\\ | ||
+ | The dimming frequentation depends of Controller Steps and Output/ | ||
+ | The brightness is divided by the number of steps, and multiplied by the delay value which is subtracted/ | ||
+ | A low step and high delay value will cause fastest dimming.\\ | ||
===Outputs=== | ===Outputs=== | ||
Line 439: | Line 436: | ||
The aspect values are compatible with __**[[: | The aspect values are compatible with __**[[: | ||
\\ | \\ | ||
+ | ====Charlieplexing Signal Support==== | ||
+ | Only available on [[: | ||
+ | A Rocrail signal with control aspects and port type multiplex, uses 4 pins starting with the port offset.\\ | ||
+ | The refresh rate is about 250µs.\\ | ||
+ | Aspect values are used from the details tab. 24bits are used, the upper 12bits are for blinking.\\ | ||
+ | Example: LED 1 and 2 on and LED 2 blinking: 0x002003 -> Aspect value = 8195 \\ | ||
+ | |||
+ | A second signal on the mast can be defined in Rocrail with address + 100 to combine it with the main signal.\\ | ||
+ | |||
+ | Brightness sets brightness, only values between 200-255 can be used. A value < 200 is set to 200.\\ | ||
+ | Fading with dimming is not possible.\\ | ||
+ | |||
+ | ^ LED Nummber for Viessmann Multiplex Signal^^^^^^^^^ | ||
+ | |LED|Pin+|Pin-|1|2|3|4|Viessmann| | | ||
+ | |1|1|2|H|L| | |Vr_Ge_O|Distant signal yellow above| | ||
+ | |2|1|3|H| |L| |Hp_Rt_R|Main signal red right| | ||
+ | |3|1|4|H| | |L|Hp_Rt_L|Main signal red left| | ||
+ | |4|2|1|L|H| | |Vr_Gr_O|Distant signal green above| | ||
+ | |5|2|3| |H|L| |Vr_Gr_u|Distant signal green below| | ||
+ | |6|2|4| |H| |L| | | | ||
+ | |7|3|1|L| |H| |Hp_Ge|Main signal yellow| | ||
+ | |8|3|2| |L|H| |Vr_Ge_U|Distant signal yellow below| | ||
+ | |9|3|4| | |H|L| Hp_Ws_L|Main signal white left| | ||
+ | |10|4|1|L| | |H|Hp_Gr|Main signal green| | ||
+ | |11|4|2| |L| |H| | | | ||
+ | |12|4|3| | |L|H|Hp_Ws_R|Main signal white right| | ||
+ | |||
+ | For a correct display of the main signal at red and shunting, the distant signal must be blanked. \\ | ||
+ | The brightness value in the main and distant signal must be identical. \\ | ||
+ | |||
+ | Multiplex inputs from Vissmann, viewed from below on the connector. \\ | ||
+ | {{: | ||
+ | \\ | ||
====Servos==== | ====Servos==== | ||
- | {{ : | + | {{ : |
The addressing is the same as normal outputs.\\ | The addressing is the same as normal outputs.\\ | ||
- | ^ Control ^ Output ^ Switch ^ Range ^ | + | ^ Control ^ Output ^ Switch |
- | | WIO | IID=" | + | | WIO | IID=" |
- | | WIO ID | Node ID (Bus) | Node ID (Bus) | 1...255 | | + | | WIO ID | Node ID (Bus) | Node ID (Bus) | Node ID (Bus) | Node ID (Bus) | 1...255 | |
- | | Servo port | Address | Address | 1...4 | | + | | Servo port | Address | Address |
- | | Extra options | - | Single gate ON | - | | + | | Extra options | - | Single gate ON | - | - | - | |
- | | Position 1 | Parameter ON | Parameter | 0...180° | | + | | Accessory | - | - | Details |
- | | Position 2 | Parameter OFF | Value | 0...180° | | + | | Position 1 | Parameter ON | Parameter |
- | | Moving speed | Delay | Switch time | 1...10 | | + | | Position 2 | Parameter OFF | Value | GREEN Value 1 * | - | 0...180° |
- | | Target | Port type " | + | | Position | - | - | - | Decoder Trak number | PWM 500...2500 ²| |
+ | | Moving speed | Delay | Switch time | Dim | Step delay| 1...10 | | ||
+ | | Target | Port type " | ||
+ | * Details tab, enter using the field with decimals in the Value button \\ | ||
+ | ² Attention, too high or too low values can damage the servo start with PWM 1500 = 0°. \\ | ||
+ | The value of the servo angle must be confirmed with enter in the decimal field. | ||
\\ | \\ | ||
====RFID==== | ====RFID==== | ||
| //Make sure that there are no servos and LEDs connected when switching to RFID.// | | //Make sure that there are no servos and LEDs connected when switching to RFID.// | ||
+ | |||
+ | Not possible with WIO Type I/O16, please use ID-12LA here. | ||
{{ : | {{ : | ||
- | - Two [[https:// | + | - Two RFID RC522 readers are supported. |
- It needs 5 extra ports; Parallel Servos are not possible. | - It needs 5 extra ports; Parallel Servos are not possible. | ||
- Reporting addresses are 100 and 101. (In Rocrail 101 and 102.) | - Reporting addresses are 100 and 101. (In Rocrail 101 and 102.) | ||
Line 464: | Line 501: | ||
\\ | \\ | ||
- | ^ Signal ^ D1 Mini ^ RFID RC522 ^ | + | |
+ | ^ Signal ^ D1 Mini ESP 8266 ^ RFID RC522 ^ | ||
| Slave Select 1 | D3 | 1 (SDA) reader 1 | | | Slave Select 1 | D3 | 1 (SDA) reader 1 | | ||
| Slave Select 2 | D0 | 1 (SDA) reader 2 | | | Slave Select 2 | D0 | 1 (SDA) reader 2 | | ||
Line 472: | Line 510: | ||
\\ | \\ | ||
+ | ====ID-12LA==== | ||
+ | {{ : | ||
+ | Optional a RFID reader from type [[http:// | ||
+ | The tag is used as **[[: | ||
+ | The **[[: | ||
+ | __The serial monitor will be set to 9600bps.__\\ | ||
+ | **Note 1:** This is to scan tags between the rails to let Rocrail know where the running vehicle is.\\ | ||
+ | **Note 2:** Use selected Tags which respond rapidly.\\ \\ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
====Pins I2C==== | ====Pins I2C==== | ||
Line 490: | Line 540: | ||
\\ | \\ | ||
+ | ====Pins S88==== | ||
+ | |< >| | ||
+ | ^ ESP8266 ^ ESP32 ^ PicoW ^ Usage ^ | ||
+ | | D0 | 12 | 10 | PS | | ||
+ | | D5 | 17 | 11 | Reset | | ||
+ | | D6 | 26 | 12 | Clock | | ||
+ | | D7 | 27 | 13 | Data | | ||
+ | |||
+ | \\ | ||
+ | |||
+ | |||
====Display SSD1306/ | ====Display SSD1306/ | ||
- | {{: | + | |{{: |
+ | | Example. | ||
Two displays can be connected to the I2C of Type SSD1306 with the I2C addresses 0x3C and 0x3D.\\ | Two displays can be connected to the I2C of Type SSD1306 with the I2C addresses 0x3C and 0x3D.\\ | ||
Formatted text is compatible with [[: | Formatted text is compatible with [[: | ||
Line 499: | Line 562: | ||
The Bus is used for the WIO ID, and the Display number for selecting between 1 and 2. (0x3C or 0x3D)\\ | 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.\\ | The Address value is not used.\\ | ||
+ | ===Multiplexing=== | ||
+ | Up to 8 display can be used with **[[: | ||
===Supported Formatting=== | ===Supported Formatting=== | ||
Formatting commands are enclose in curly brackets. | Formatting commands are enclose in curly brackets. | ||
Line 506: | Line 571: | ||
</ | </ | ||
^ Command ^ Parameter ^ Description ^ Remark ^ | ^ Command ^ Parameter ^ Description ^ Remark ^ | ||
+ | | {A...} | 0...9 & : | Enlarged numbers. | Example: {A%hour%: | ||
| {B#} | # | | {B#} | # | ||
- | | {B'// | + | | {B'// |
| {E} | - | Erase display buffer. An extra {P} is needed to erase the display. | | | {E} | - | Erase display buffer. An extra {P} is needed to erase the display. | | ||
| {F#} | #=0-2 | Select font. 0=7x5 1=6x5w 2=6x5n | Font 5x5 is not supported because its unreadable. | | | {F#} | #=0-2 | Select font. 0=7x5 1=6x5w 2=6x5n | Font 5x5 is not supported because its unreadable. | | ||
Line 514: | Line 580: | ||
| {L#} | #=0-3 | Goto line. The range depends on the display size. (Y = L * 8) | | | {L#} | #=0-3 | Goto line. The range depends on the display size. (Y = L * 8) | | ||
| {P} | - | Copy buffer to the display. | | | {P} | - | Copy buffer to the display. | | ||
- | | {R#} | #=0,2 | Set display mapping rotation. 0=0° 2=180° | | + | | {R#} | #=0,2 | Set display mapping rotation. 0=0° 2=180° |
| {?V} | - | Show firmware version. | | | {?V} | - | Show firmware version. | | ||
| {X#} | #=0-127 | Goto column. The range depends on the display size. | | | {X#} | #=0-127 | Goto column. The range depends on the display size. | | ||
| {Y#} | #=0-32 | Goto row. The range depends on the display size. | | | {Y#} | #=0-32 | Goto row. The range depends on the display size. | | ||
- | ^ New command ^ Parameter ^ Description ^ | ||
| {c#} | #=1-16 | Draw an analog clock with the given radius on the current position. | Only one (fast) clock per display will be updated. | | | {c#} | #=1-16 | Draw an analog clock with the given radius on the current position. | Only one (fast) clock per display will be updated. | | ||
- | | {g#} | # | + | | {g#} | # |
| {i} | - | Toggle inverted text. | | | {i} | - | Toggle inverted text. | | ||
| {s#} | #=1-x | Draw scrolling text on the current position, with a view width of n characters. | Example: {s12}Scrolling text to show...{s} | | | {s#} | #=1-x | Draw scrolling text on the current position, with a view width of n characters. | Example: {s12}Scrolling text to show...{s} | | ||
| {d} | - | Scroll one text line down. | | | {d} | - | Scroll one text line down. | | ||
| {f#} | #=1-2 | 7-Segment fast clock. | Only one (fast) clock per display will be updated. | | | {f#} | #=1-2 | 7-Segment fast clock. | Only one (fast) clock per display will be updated. | | ||
+ | | {f7} | - | User defined fast clock. \\ __Needed files:__ 0.amp...9.amp and colon.amp | Example data: {{: | ||
+ | | {f8} | - | Same as {f7} but with leading hour zero if needed. | Example: 08:22 instead of 8:22| | ||
| {p} | - | Swap displays. | | | {p} | - | Swap displays. | | ||
| {l#,#} | - | Draw a line from X,Y to #,# | | | {l#,#} | - | Draw a line from X,Y to #,# | | ||
Line 530: | Line 597: | ||
| {z#} | - | Draw a circle with center and radius # | | | {z#} | - | Draw a circle with center and radius # | | ||
| {x#,#} | - | Draw a pixel at #,# | | | {x#,#} | - | Draw a pixel at #,# | | ||
+ | | {+} | - | [[: | ||
+ | | {-} | - | Stop using large characters. | | ||
+ | |||
**Note:** //If the geometry is not default, 128x32, the text MUST start with a {gn} command for selecting the right geometry.// | **Note:** //If the geometry is not default, 128x32, the text MUST start with a {gn} command for selecting the right geometry.// | ||
Line 589: | Line 659: | ||
| D7 | PWM reverse direction | IN2 | | | | D7 | PWM reverse direction | IN2 | | | ||
| D8 | Servo PWM for coupler | | F1 | | | D8 | Servo PWM for coupler | | F1 | | ||
- | | I2C 1-32 | Functions 1 to 32 | | | | + | | I2C 1-32 | Functions 1 to 32 | | The [[: |
| A0 | Battery monitor LiPo 3S | | + 100kΩ A0 32kΩ - | | | A0 | Battery monitor LiPo 3S | | + 100kΩ A0 32kΩ - | | ||
Acceleration/ | Acceleration/ | ||
Line 598: | Line 668: | ||
Note: __**Only connect ground and PWM in case the ESC supports BEC.**__\\ | Note: __**Only connect ground and PWM in case the ESC supports BEC.**__\\ | ||
\\ | \\ | ||
- | ====ID-12LA==== | + | |
- | {{ : | + | |
- | Optional a RFID reader from type [[http:// | + | |
- | The tag is used as **[[: | + | |
- | The **[[: | + | |
- | __The serial monitor will be set to 9600bps.__\\ | + | |
- | **Note 1:** This is to scan tags between the rails to let Rocrail know where the running vehicle is.\\ | + | |
- | {{ : | + | |
- | **Note 2:** Use selected Tags which respond rapidly.\\ | + | |
- | \\ | + | |
====RailCom==== | ====RailCom==== | ||
{{ : | {{ : | ||
Line 634: | Line 695: | ||
====Sound==== | ====Sound==== | ||
Sound can be played on ESP32 boards using one of the DAC pins. (GPIO25 or GPIO26)\\ | Sound can be played on ESP32 boards using one of the DAC pins. (GPIO25 or GPIO26)\\ | ||
+ | The USER_SOUND in the USERCNF.h must be set to true: | ||
+ | < | ||
+ | // Sound | ||
+ | #define USER_SOUND | ||
+ | </ | ||
Supported [[ https:// | Supported [[ https:// | ||
* PCM type | * PCM type | ||
Line 663: | Line 729: | ||
| 2 | IN3 | ENABLE+ | | | 2 | IN3 | ENABLE+ | | ||
| 15 | IN4 | - | | | 15 | IN4 | - | | ||
- | | DA1 | - | | Hall/Reed calibrate sensor | | + | | 25 | - | | Hall/Reed calibrate sensor | |
| EP1-1 | GND | CLK-, | | EP1-1 | GND | CLK-, | ||
| - | VCC | 12V-45V DC | External power supply | | | - | VCC | 12V-45V DC | External power supply | | ||
Line 672: | Line 738: | ||
| Address | 1 | Fixed | | | Address | 1 | Fixed | | ||
| Lights | | Lights | ||
+ | | Decoder steps | 0-16777215 | Nr of steps for one 360° rotation. \\ In case of a 28BYJ-48: 4096 steps. | | ||
+ | | Correction | 0-255 | To compensate for the gear backlash. | | ||
+ | | Step delay | 1-10 | Size of the start and deceleration ramp | | ||
+ | | Offset | -32767...+32767 | Calibration correction point in steps. | | ||
| Type | wio | | | Type | wio | | ||
- | | Decoder steps | Nr of steps for one 360° rotation. \\ In case of a 28BYJ-48: 4096 steps. | + | | rotation |
//The number of decoder steps for one turntable rotation is needed to calculate the shortest way.//\\ | //The number of decoder steps for one turntable rotation is needed to calculate the shortest way.//\\ | ||
\\ | \\ | ||
Line 693: | Line 763: | ||
</ | </ | ||
+ | === Output-Setup === | ||
+ | |||
+ | |< >| | ||
+ | | Interface | | ||
+ | ^ Field ^ Value ^ Remark ^ | ||
+ | | Node ID | WIO ID | | | ||
+ | | Adress | 1 | //fix// | | ||
+ | | Parameter on | 0-16777215 | Number of steps counterclockwise | | ||
+ | | Parameter off | 0-16777215 | Number of steps clockwise | | ||
+ | | Delay | 0-255 | rotation speed \\ If the value is >0, an acceleration and braking ramp is generated. | | ||
+ | | Type | Motor | | ||
+ | |||
+ | Calibration is not possible! | ||
- | \\ | ||
====CAN==== | ====CAN==== | ||
Line 730: | Line 812: | ||
====Sensor setup==== | ====Sensor setup==== | ||
- | < | + | < |
The reported RFID must mach with a __**[[: | The reported RFID must mach with a __**[[: | ||
- | This sensor should have its address | + | The sensor |
The ID must be set in this notation: __**[[: | The ID must be set in this notation: __**[[: | ||
The Rocrail traces can be used to copy this ID or the __**[[: | The Rocrail traces can be used to copy this ID or the __**[[: | ||
Line 744: | Line 826: | ||
\\ | \\ | ||
+ | |||
+ | =====KeyPad===== | ||
+ | {{ : | ||
+ | A KeyPad is supported on WIO Type IO16 on I/O connector 1. | ||
+ | The # key will send the input to Rocrail es Text event. Rocrail will look up a Text object with this NodeID set on the interface tab.\\ | ||
+ | With the * key the input can be corrected.\\ | ||
+ | If a display is connected the input will be shown on line 3, but can be changed in the USERCNF.h. (Zero based line offset.)\\ | ||
+ | Supportes KeyPads: 3x4 and 4x4. The 4x4 has " | ||
+ | It is recommended to set the ports 1...8 on the setup tab as follows:\\ | ||
+ | {{: | ||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
=====Hardware===== | =====Hardware===== | ||
The firmware for IO-Type RIC does not function without pull-up resistors on the button inputs, including the rotary switch. | The firmware for IO-Type RIC does not function without pull-up resistors on the button inputs, including the rotary switch. | ||
Line 784: | Line 880: | ||
===Upload tool ESP32=== | ===Upload tool ESP32=== | ||
* https:// | * https:// | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | \\ | ||
+ | =====Programming WIO Binary with Arduino IDE Tools===== | ||
+ | |||
+ | | Arduino IDE 1.8.16 | ||
+ | |||
+ | ====macOS "Big Sur" | ||
+ | ===ESP8266=== | ||
+ | < | ||
+ | export WIOBIN=~/ | ||
+ | |||
+ | / | ||
+ | / | ||
+ | --chip esp8266 --port / | ||
+ | </ | ||
+ | ===ESP32=== | ||
+ | < | ||
+ | ~/ | ||
+ | --chip esp32 \ | ||
+ | --port / | ||
+ | --baud 921600 \ | ||
+ | --before default_reset \ | ||
+ | --after hard_reset write_flash \ | ||
+ | -z \ | ||
+ | --flash_mode dio \ | ||
+ | --flash_freq 80m \ | ||
+ | --flash_size 4MB \ | ||
+ | 0x10000 WIO.ino.d1_mini32.bin | ||
+ | </ | ||
+ | |||
+ | |||
+ | ====Windows 10==== | ||
+ | < | ||
+ | set WIOBIN=\Users\%USERNAME%\Downloads\WIO.ino.d1_mini.bin | ||
+ | |||
+ | C: | ||
+ | </ | ||
+ | |||
+ | ====PiOS-64 " | ||
+ | < | ||
+ | export WIOBIN=/ | ||
+ | |||
+ | / | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ |
arduino/wio-en.1631045534.txt.gz · Last modified: 2021/09/07 22:12 by rjversluis