Component: GameCode (Misc Circuit): Difference between revisions
Appearance
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;"" to "width="10%" align="center" class="mtx-class-macrohead"" |
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"" |
||
| Line 69: | Line 69: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''BatteryRead''' | ||
|- | |- | ||
| colspan="2" | Read and return the voltage level of the battery in millivolt. | | colspan="2" | Read and return the voltage level of the battery in millivolt. | ||
| Line 83: | Line 83: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''DisplayBrightness''' | ||
|- | |- | ||
| colspan="2" | Control the brightness of the display. | | colspan="2" | Control the brightness of the display. | ||
| Line 102: | Line 102: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''DisplayClear''' | ||
|- | |- | ||
| colspan="2" | Clear the display. | | colspan="2" | Clear the display. | ||
| Line 116: | Line 116: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''DisplayWrite''' | ||
|- | |- | ||
| colspan="2" | Write an array containing 16 bytes to the display to illuminate the corresponding dots. The index represents the line (Y-axis), starting from 0 for the uppermost line. The value of the byte represents the column (X-axis), with MSB the leftmost dot. | | colspan="2" | Write an array containing 16 bytes to the display to illuminate the corresponding dots. The index represents the line (Y-axis), starting from 0 for the uppermost line. The value of the byte represents the column (X-axis), with MSB the leftmost dot. | ||
| Line 135: | Line 135: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''DisplayWriteNumber''' | ||
|- | |- | ||
| colspan="2" | Show a number ranging from 000 to 999 on the display. Number is printed vertically. | | colspan="2" | Show a number ranging from 000 to 999 on the display. Number is printed vertically. | ||
| Line 154: | Line 154: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''EEReadValue''' | ||
|- | |- | ||
| colspan="2" | Retreives a value from none volitile memory | | colspan="2" | Retreives a value from none volitile memory | ||
| Line 173: | Line 173: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''EEStoreValue''' | ||
|- | |- | ||
| colspan="2" | Saves a value to none volitile memory | | colspan="2" | Saves a value to none volitile memory | ||
| Line 197: | Line 197: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Initialise''' | ||
|- | |- | ||
| colspan="2" | Initializes all present hardware and communication. Place this at the very start of your code. | | colspan="2" | Initializes all present hardware and communication. Place this at the very start of your code. | ||
| Line 211: | Line 211: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LedsWrite''' | ||
|- | |- | ||
| colspan="2" | Set the button-leds. MSB = leftmost led LSB = rightmost led | | colspan="2" | Set the button-leds. MSB = leftmost led LSB = rightmost led | ||
| Line 230: | Line 230: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''MP3GetStatus''' | ||
|- | |- | ||
| colspan="2" | Returns the status of the MP3 module. 0 = module in sleep 1 = track is playing 2 = track is pauzed 3 = track is stopped | | colspan="2" | Returns the status of the MP3 module. 0 = module in sleep 1 = track is playing 2 = track is pauzed 3 = track is stopped | ||
| Line 244: | Line 244: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''MP3PausePlayResetStop''' | ||
|- | |- | ||
| colspan="2" | Allows the current playing track to be paused, restarted or stopped. | | colspan="2" | Allows the current playing track to be paused, restarted or stopped. | ||
| Line 263: | Line 263: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''MP3PlayTrack''' | ||
|- | |- | ||
| colspan="2" | Plays track from the selected folder. MP3 & Advert folder track numbers should be 4 characters long e.g. "0001-anyname.mp3". Other folder track numbers should be 3 characters long e.g. "001-anyname.mp3". | | colspan="2" | Plays track from the selected folder. MP3 & Advert folder track numbers should be 4 characters long e.g. "0001-anyname.mp3". Other folder track numbers should be 3 characters long e.g. "001-anyname.mp3". | ||
| Line 287: | Line 287: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''MP3SendCommand''' | ||
|- | |- | ||
| colspan="2" | Send commands to MP3 module. Check datasheet for info. | | colspan="2" | Send commands to MP3 module. Check datasheet for info. | ||
| Line 316: | Line 316: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''MP3SetVolume''' | ||
|- | |- | ||
| colspan="2" | Sets the volume level for the MP3 module | | colspan="2" | Sets the volume level for the MP3 module | ||
| Line 335: | Line 335: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''PlayNote''' | ||
|- | |- | ||
| colspan="2" | Output a single note on the buzzer. Specify the desired frequency (Hz) and duration (ms). | | colspan="2" | Output a single note on the buzzer. Specify the desired frequency (Hz) and duration (ms). | ||
| Line 359: | Line 359: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''PotRead''' | ||
|- | |- | ||
| colspan="2" | Read and return the value of the potentiometer. If desired, give the upper limit to scale the output value. Enter "MaxValue = 0" to skip scaling and get the byte value (0-255) | | colspan="2" | Read and return the value of the potentiometer. If desired, give the upper limit to scale the output value. Enter "MaxValue = 0" to skip scaling and get the byte value (0-255) | ||
| Line 378: | Line 378: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''PwrLedSet''' | ||
|- | |- | ||
| colspan="2" | Control the PWR LED. 0 = red + green 1 = red 2 = green | | colspan="2" | Control the PWR LED. 0 = red + green 1 = red 2 = green | ||
| Line 398: | Line 398: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
Revision as of 14:23, 13 July 2026
| Author | Jef De Bruyne |
| Version | 1.0 |
| Category | Misc Circuit |
GameCode component
A small handheld device designed for creating embedded games. Complete with a 8 x 16 LED display, 4-Way DPAD with 4 additional push switches Buzzer, Vibration, MP3 Player, Potentiometer and Lithium battery management. Programmed via USB.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_GameCode_Master.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_GameCode_Master.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
BatteryRead
| BatteryRead | |
| Read and return the voltage level of the battery in millivolt. | |
| Return | |
DisplayBrightness
| DisplayBrightness | |
| Control the brightness of the display. | |
| Value | |
| Enter value from 0 to 15 | |
| Return | |
DisplayClear
| DisplayClear | |
| Clear the display. | |
| Return | |
DisplayWrite
DisplayWriteNumber
| DisplayWriteNumber | |
| Show a number ranging from 000 to 999 on the display. Number is printed vertically. | |
| Value | |
| Enter a number from 0 to 999. | |
| Return | |
EEReadValue
| EEReadValue | |
| Retreives a value from none volitile memory | |
| Address | |
| Address to write to, Range: 0-255 | |
| Return | |
EEStoreValue
| EEStoreValue | |
| Saves a value to none volitile memory | |
| Address | |
| Address to write to, Range: 0-255 | |
| Value | |
| Value to store, Range: 0-255 | |
| Return | |
Initialise
| Initialise | |
| Initializes all present hardware and communication. Place this at the very start of your code. | |
| Return | |
LedsWrite
| LedsWrite | |
| Set the button-leds. MSB = leftmost led LSB = rightmost led | |
| Value | |
| MSB = leftmost dot, LSB = rightmost dot | |
| Return | |
MP3GetStatus
| MP3GetStatus | |
| Returns the status of the MP3 module. 0 = module in sleep 1 = track is playing 2 = track is pauzed 3 = track is stopped | |
| Return | |
MP3PausePlayResetStop
| MP3PausePlayResetStop | |
| Allows the current playing track to be paused, restarted or stopped. | |
| Mode | |
| 0=Pause, 1=Play, 2=Reset, 3=Stop | |
| Return | |
MP3PlayTrack
MP3SendCommand
| MP3SendCommand | |
| Send commands to MP3 module. Check datasheet for info. | |
| Command | |
| Para1 | |
| Para2 | |
| Return | |
MP3SetVolume
| MP3SetVolume | |
| Sets the volume level for the MP3 module | |
| Volume | |
| Range: 0 (min) - 30 (max) | |
| Return | |
PlayNote
PotRead
PwrLedSet
| PwrLedSet | |
| Control the PWR LED. 0 = red + green 1 = red 2 = green | |
| Value | |
| 0 = red + green, 1 = red, 2 = green | |
| Return | |
Property reference
| Properties | |
| LED Colours | |
| LED On | |
| LED Off | |
| Display Colours | |
| On Colour | |
| Off Colour | |
| Background Colour | |