forked from dagnall53/WiRocS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Chuff.h
66 lines (54 loc) · 1.54 KB
/
Chuff.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef Chuff_h
#define Chuff_h
#include "Directives.h"
// #include "Globals.h"
#include <Arduino.h> //needed
#define _AudioDebug
bool ChuffsOn(void);
bool AlternateSounds(void);
void SetChuffPeriod(uint8_t Speed, int WavsPerRevolution );
//void SetChuffPeriodFromSpeed(uint16_t value);
//void SetChuffPeriodFromServoPos(uint16_t value);
void SetSoundEffect(uint8_t Data1,uint8_t Data2,uint8_t Data3);
void SetUpAudio(uint32_t TimeNow);
bool FileExists(const char *wavfilename);
void BeginPlay(int Channel,const char *wavfilename, uint8_t CVVolume);
void BeginPlayND(int Channel,const char *wavfilename, uint8_t CVVolume); //no deletes version used for the first play. after this can delete opened stuff
bool TimeToChuff(uint32_t TimeNow);
void Chuff(String ChuffChoice, String ChuffChoiceFast,long ChuffSwitchSpeed);
void AudioLoop(int32_t TimeNow);
bool SoundEffectPlaying(void);
void SoundEffects(void);
/*/ uses RX/d9, D8, and D4 pins.
static const uint8_t D4 = 2; and Blue Led on SP8266
static const uint8_t D5 = 14; for chuff output
static const uint8_t D8 = 15;
*/
/*//Temporary override sound volumes
CV[100]=127; //Overall volume control
CV[101]=127; //volume for F1
CV[102]=127;
CV[103]=127;
CV[104]=127;
CV[105]=127;
CV[106]=127;
CV[107]=127;
CV[108]=127; //Volume for F8
CV[110]=127; //volume for chuffs
CV[111]=127; //volume for Brake Squeal
//
*/
/*expected wav files are:
Initiate sound:
/initiated.wav
CHUFFS:
/ch1.wav
/ch2.wav
/ch3.wav
/ch4.wav
Whistle:
/whistle.wav
Brake Squeal
/brakes.wav
*/
#endif