ViSi-Genie: Water Level Monitoring
Introduction
This codebase example will demonstrate how to get a sensor value with pin input widgets on the ViSi-Genie environment. We will use transistors as switches to act as a sensor, which, when toggled, will activate a magic event. This magic event will evaluate and show the results on display using the tank widget and status on the string widget. The display module will show if the container is empty, running low, above half, or almost full.
Note
Workshop4 Pro is needed for this code example.
Prerequisites
This codebase example assumes the reader can program the 4D Systems display module using Workshop4 IDE designer environment. Beginners are advised to read the following aplication notes.
- ViSi-Genie: Getting Started with DIABLO-16 Displays
- ViSi-Genie: Pin Input and Output for DIABLO-16 Display Modules
Needed Materials
- Gen4-uLCD-43DCT-CLB
- 30-way FFC
- 4D-UPA
- BC547 transistor – 3
- 10k ohms resistors – 6
- 100k ohms resistors - 1
- Jumper wires
- breadboard
Instructions
Hardware Setup
Refer to the circuit diagram below for the circuit connections.
Programming the Display
- Download and extract the attached project below.
- Navigate to the location of the extracted file and open the waterlvl.4DGenie file by double-clicking or using Workshop4 Pro.
- Connect the target display to your computer.
- Go to Project tab and set the display to your target display.
- Go to comms tab to check if the connected display is detected by the Workshop4.
- Return to the Home tab to program the display using the Download button.
- A pop-up window will ask you to select the drive to save the .dat and .gci files.
- Wait until the download is successful.
- Remove the microSD card from your computer and insert it into the card slot on the display.
- Power up the display