Jump to content

Component: GameCode (Misc Circuit): Difference between revisions

From Flowcode Help
m Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable""
Line 66: Line 66:


===BatteryRead===
===BatteryRead===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 80: Line 80:


===DisplayBrightness===
===DisplayBrightness===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 99: Line 99:


===DisplayClear===
===DisplayClear===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 113: Line 113:


===DisplayWrite===
===DisplayWrite===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 132: Line 132:


===DisplayWriteNumber===
===DisplayWriteNumber===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 151: Line 151:


===EEReadValue===
===EEReadValue===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 170: Line 170:


===EEStoreValue===
===EEStoreValue===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 194: Line 194:


===Initialise===
===Initialise===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 208: Line 208:


===LedsWrite===
===LedsWrite===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 227: Line 227:


===MP3GetStatus===
===MP3GetStatus===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 241: Line 241:


===MP3PausePlayResetStop===
===MP3PausePlayResetStop===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 260: Line 260:


===MP3PlayTrack===
===MP3PlayTrack===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 284: Line 284:


===MP3SendCommand===
===MP3SendCommand===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 313: Line 313:


===MP3SetVolume===
===MP3SetVolume===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 332: Line 332:


===PlayNote===
===PlayNote===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 356: Line 356:


===PotRead===
===PotRead===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 375: Line 375:


===PwrLedSet===
===PwrLedSet===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 395: Line 395:
==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]

Revision as of 14:15, 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.  
- UINT Return


DisplayBrightness

DisplayBrightness
Control the brightness of the display.  
- BYTE Value
Enter value from 0 to 15 
- VOID Return


DisplayClear

DisplayClear
Clear the display. 
- VOID Return


DisplayWrite

DisplayWrite
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. 
- BYTE Array
Index = line, Content (byte) = column 
- VOID Return


DisplayWriteNumber

DisplayWriteNumber
Show a number ranging from 000 to 999 on the display. Number is printed vertically.  
- UINT Value
Enter a number from 0 to 999. 
- VOID Return


EEReadValue

EEReadValue
Retreives a value from none volitile memory 
- BYTE Address
Address to write to, Range: 0-255 
- BYTE Return


EEStoreValue

EEStoreValue
Saves a value to none volitile memory 
- BYTE Address
Address to write to, Range: 0-255 
- BYTE Value
Value to store, Range: 0-255 
- VOID Return


Initialise

Initialise
Initializes all present hardware and communication. Place this at the very start of your code. 
- VOID Return


LedsWrite

LedsWrite
Set the button-leds. MSB = leftmost led LSB = rightmost led 
- BYTE Value
MSB = leftmost dot, LSB = rightmost dot 
- VOID 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 
- BYTE Return


MP3PausePlayResetStop

MP3PausePlayResetStop
Allows the current playing track to be paused, restarted or stopped. 
- BYTE Mode
0=Pause, 1=Play, 2=Reset, 3=Stop 
- VOID Return


MP3PlayTrack

MP3PlayTrack
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". 
- BYTE Directory
0=Root, 01=Folder "01" - 99=Folder "99", 100=Folder "MP3", 101=Advert 
- UINT Track
Track number 1 = "001.mp3" / "0001.mp3" 
- VOID Return


MP3SendCommand

MP3SendCommand
Send commands to MP3 module. Check datasheet for info. 
- BYTE Command
 
- BYTE Para1
 
- BYTE Para2
 
- VOID Return


MP3SetVolume

MP3SetVolume
Sets the volume level for the MP3 module 
- BYTE Volume
Range: 0 (min) - 30 (max) 
- VOID Return


PlayNote

PlayNote
Output a single note on the buzzer. Specify the desired frequency (Hz) and duration (ms). 
- UINT Frequency
Sets the pitch for the note in Hz. Range 1-20000 Hz 
- ULONG Duration
Time period to play the note for in milliseconds. Range 0-65535 ms 
- VOID Return


PotRead

PotRead
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) 
- UINT MaxValue
Scale the return value. Enter 0 to skip. 
- UINT Return


PwrLedSet

PwrLedSet
Control the PWR LED. 0 = red + green 1 = red 2 = green 
- BYTE Value
0 = red + green, 1 = red, 2 = green 
- VOID Return


Property reference

Properties
LED Colours
LED On
 
LED Off
 
Display Colours
On Colour
 
Off Colour
 
Background Colour