This project uses MOTG RS232 as communication interface between two gen4 display modules. The device 1 is gen4-uLCD-35DT as controller, and device 2 is gen4-uLCD-32D-CLB as monitor at the same time controls RGB Led and Servo motor connected through the PWM pins.
The MOTG RS232 are attached to each devices that converts the TTL level voltage from the display to the RS232 level voltage. This RS232 level voltage can now be transmitted over a distance between the two gen4 displays.
How it Works- gen4 –uLCD-35DT
- gen4 –uLCD-32D-CLB
- gen4PA
- gen4IB
- Breadtooth
- MOTG RS232
- RGB Led
- Servo Motor
- 330 ohm resistors
- DB9 Connector(Male)
- Serial Cable (female to female)
- FFC Cable
- Jumper wires
Build the circuit as shown in the diagram.
Device 1
- Connect the display and gen4-IB (Interface Board) using FFC cable.
- Put the Breadtooth to the breadboard.
- Using jumper wires, connect the Rx and Tx of the gen4-IB to the Rx and Tx of the Breadtooth, respectively.
- Solder a wire to the DB9 male connector pin 2, pin 3, and pin 5. Connect the wire to the MOTG RS232, pin 2 to the Tx, pin 3 to the Rx, and pin 5 to the GND.
- Slide the MOTG RS232 to the Breadtooth.
- Connect Serial cable to the DB9 connector.
Device 2
- Connect the display and gen4-PA using FFC Cable.
- Put the Breadtooth on the breadboard.
- Using jumper wires, connect the Rx and Tx of the gen4-IB to the Rx and Tx of the Breadtooth, respectively.
- Solder a wire to the DB9 male connector pin 2, pin 3, and pin 5. Connect the wire to the MOTG RS232, pin 2 to the Rx, pin 3 to the Tx, and pin 5 to the GND.
- Slide the MOTG RS232 to the Breadtooth.
- Connect Serial cable to the DB9 connector.
Download the project file here.
You can download Workshop 4 IDE and the complete code for this project from our website.
Device 1 Code- TrackBar1 - for changing the red colour of the LED
- TrackBar2 - for changing the green colour of the LED
- TrackBar3 - for changing the blue colour of the LED
To be able to use the knob, you need to include the XYposToDegree library:
- Knob – for changing the angle of the servo motor
- Sending data to the serial
- Define constant
- Use COM1
- Main
If the device 2 received the qualifier which is ‘@’, the two device will now sync and if the but if it is greater than 2, it will start capturing data and put it to ID, val and chk.
Step 3: CompileClick on the “Compile” button.
Note: This step could be skipped. However, compiling is essential for debugging purposes.
Step 4: Comms PortConnect the display to the PC. Make sure that you are connected to the right port. Red Button indicates that the device is not connected, Blue Button indicates that the device is connected to the right port.
Go back to “Home” tab. This time, click on the “Comp’nLoad” button.
Workshop 4 will prompt you to select a drive to copy the image files to a uSD Card. After selecting the correct drive, click OK.
Comments