Jump to content

Component: Tone Generator (Runtime Tools)

From Flowcode Help
Revision as of 10:38, 17 November 2021 by Wiki bot (talk | contribs)
Author Matrix TSL
Version 1.0
Category Runtime Tools


Tone Generator component

A component to generate simple mono tone audio tones for use in alarms or other audible feedback.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

PlayTone
Blocking call that plays a tone for a specific period of time. 
- BYTE Tone
0=Off, 1=C, 2=C#, 3=D, 4=D#, 5=E, 5=F, 6=F#, 7=G, 8=G#, 9=A, 10=A#, 11=B, 12=C 
- UINT Delay
delay in milliseconds 
- VOID Return


SetTone
Sets the output tone without blocking for the tone to end To end the note the macro must be called again with the tone paramete set to 0. 
- BYTE Tone
0=Off, 1=C, 2=C#, 3=D, 4=D#, 5=E, 5=F, 6=F#, 7=G, 8=G#, 9=A, 10=A#, 11=B, 12=C 
- VOID Return


ClearBuffer
Erases the contents of the buffer 
- VOID Return


ReadDigitalInputs
Reads the state of up to eight digital inputs. Can pack a max of 8-bits together in a single operation 
- UINT StartAddress
Coil Address Range 0 to (NumCoils - 1) 
- BYTE AddressCount
Range 1-8 
- BYTE Return


GetLastIncoming
Gets a value from the last incoming command. Index 0 = 0 Read / 1 Write Index 1 = 0 Coils / 1 DigInput / 2 AnInput / 3 Register Index 2 = Address Index 3 = Number 
- UINT Return


SetAnalogInput
Sets the state of a single analogue input. 
- UINT Address
Coil Address 
- UINT Value
Analogue Value range 0 - 65535 
- VOID Return


Initialise
Starts up the UART to allow communications and initialises the states of the various Modbus Coils, Inputs and Registers to 0. 
- VOID Return


AppendStringToFile
Adds the contents of the data string parameter to the end of the currently open file. Returns 0 for success. 
- STRING Data_String
Data to append to the end of the file 
- BYTE Return


ReadFileSize
Reads the entire size of the current file in bytes. 
- ULONG Return


SetTimeAndDate
Sets the current time and date. Time = (Hour << 11) + (Min << 5) + (Sec >> 1) Date = (YearFrom1980 << 9) + (Month << 5) + (Day) Additional details can be found here: http://www.maverick-os.dk/FileSystemFormats/FAT16_FileSystem.html#TimeFormat 
- UINT Time
Sets the current Time in FAT Time format hhhhhmmmmmmsssss - S=Secs/2 
- UINT Date
Sets the current Date in FAT Date format yyyyyyymmmmddddd - Y=Years since 1980 
- VOID Return


Initialise
Attempts to communicate with the SD card and if successful sets up the file system. Returns 0 for success.  
- BYTE Return


Initialise
Initialise the comms to the Arduino board ready for commands to be sent. 
- VOID Return


ReadAnalogInput
Reads a single digital input. 
- BYTE Channel
 
- UINT Return


PWMEnable
Allows pulse width modulated transistor outputs to be switched on or off. Bit 0 = Enable AB Bit 1 = A / Bit 2 = B Bit 3 = C / Bit 4 = D Bit 5 = Enable CD 
- BYTE EnableMask
Range 0-63 or 0b00000 to 0b111111 
- VOID Return


Initialise
 
- VOID Return


LCDClear
Clears the MIAC display 
- VOID Return


LCDClear
Clears the LCD 
- VOID Return



Property reference

Properties
Connections
Simulations