Jump to content

Lighting your Star trek federation models - HOW TO (programming)


Recommended Posts

Good to hear warren, remember that the cjip in the main post has enough pins for all your different code outputs plus a few extra probably so when you get to it you can add display case lighting to the code even push button use/activation for it

Link to post
Share on other sites

Cheers Chris,

The next one will be for a SW X-Wing on a Death Star Base so will probably use the 85 again.

Warren

Link to post
Share on other sites
  • 2 weeks later...

Brilliant posts. Bought an Arduino about 18 months ago with every intention of trying some lighting using it. Furthest I got was flashing an led! If I was to program an ATTiny how would I use it in a model? ie how would I build a board with chip and connect it to lights in a model? (enterprise refit for example) I'm an amateur where electronics is concerned but I'm sure others would be interested in this.

Thanks.

Link to post
Share on other sites

hi there,

depending on the model, in this case, the enterprise refit, which for size perpouse i will assume you mean the 1/350 polar lights refit model being one of the largest,

you would want an atmel chip with enough pwm channels so accomodate all the fadings you would want, as well as enough standard pins for the on/off/flash/blinking functions.

you would need to have a 5v power supply rated for 2amps.

this would give you enough current and voltage to run the leds, and the atmel chip.

you would need a mosfet with the correct specifications to use with the atmel chip.

the mosfet acts as a "gate" between the chip and the leds allowing power to flow.

the mosfet has 3 pins, put it lamens terms, the 3 pins are "activate, power in and power out.

they are needed because the atmel chip cannot supply enough power to the large number of leds required.

i will be making a kit im sending out to a fella in america in the next week or so, so i will take lots of pictures of the process as it will require mosfets and led strips and a programed atmel chip, then i will do a write up on the hardware side.

so be patient with me in the mean time and i will drop you a pm when the write up is done. im sure it will answer many questions.

  • Like 1
Link to post
Share on other sites

Brilliant, look forward to this! I have four Ent 1/350 refits that I hope to build (sad I know) but want to at least do justice to a couple of them and have been looking for a reasonably priced lighting solution.

Link to post
Share on other sites

building your own is probably the cheapest in the way that your not paying labour fees either.

if you download the enterprise sketch in from first post (i think) its for the refit, and has various fades and so on and has explanations on various parts of it, take a look and see what you think, hook up some led's to your arduino and play with it, make changes and learn how it works :)

  • Like 1
Link to post
Share on other sites
  • 1 year later...

when I try to compile this code the error I am getting is the following:

Arduino: 1.6.0 (Windows 7), Board: "Arduino Leonardo"
enterprise_program_6.ino:3:22: fatal error: LedFader.h: No such file or directory
compilation terminated.
Error compiling.
As I am still fairly new to arduino and it's programming language, I wounder if you could shed some light on this.
Sorry for the noob question...
Link to post
Share on other sites

Hi NAP-Richard,

Sounds like you haven't download the LedFlasher.h file into the library folder. Also are you using an Arduino Leonardo, if not you will need to set the board within Tools to the board you are using.

Cheers,

Warren

Link to post
Share on other sites

Hi NAP-Richard,

Sounds like you haven't download the LedFlasher.h file into the library folder. Also are you using an Arduino Leonardo, if not you will need to set the board within Tools to the board you are using.

Cheers,

Warren

Thanks #Madmonk that was totally the issue. In answer to your question regarding the Arduino Leonardo, I am using it and have it set correctly in my settings.

Cheers

Richard

Link to post
Share on other sites
  • 8 months later...

Hey guys. Im gonna ask some fairly dumb questions but please bear with me as i am learning all of this from the ground up.

First this link http://sdrv.ms/10XPJWh is no longer available. Do you know what it was and where i can get it?

I also need the LEDflasher.h and LEDfader.h files. I found some via Google but they are giving me errors.

Here is a copy of the errors im getting.

Arduino: 1.6.6 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware "C:\Program Files (x86)\Arduino\hardware" -tools "C:\Program Files (x86)\Arduino\tools-builder" -tools "C:\Program Files (x86)\Arduino\hardware\tools\avr" -built-in-libraries "C:\Program Files (x86)\Arduino\libraries" -libraries "C:\Users\whyno_000\Documents\Arduino\libraries" -fqbn=arduino:avr:uno -ide-version=10606 -build-path "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp" -warnings=all -prefs=build.warn_data_percentage=75 -verbose "C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino"
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware "C:\Program Files (x86)\Arduino\hardware" -tools "C:\Program Files (x86)\Arduino\tools-builder" -tools "C:\Program Files (x86)\Arduino\hardware\tools\avr" -built-in-libraries "C:\Program Files (x86)\Arduino\libraries" -libraries "C:\Users\whyno_000\Documents\Arduino\libraries" -fqbn=arduino:avr:uno -ide-version=10606 -build-path "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp" -warnings=all -prefs=build.warn_data_percentage=75 -verbose "C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "C:\Users\whyno_000\Documents\Arduino\libraries\LEDFader\Curve.cpp"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "C:\Users\whyno_000\Documents\Arduino\libraries\LEDFader\LEDFader.cpp"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "C:\Users\whyno_000\Documents\Arduino\libraries\LEDFader\LEDflasher.cpp"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino2/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\preproc\ctags_target.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino2/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\preproc\ctags_target.cpp"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp" -o "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp.o"
In file included from C:\Users\whyno_000\Documents\Arduino\libraries\LEDFader/LEDFlasher.h:13:0,

from C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino:2:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM/EEPROM.h:43:30: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

operator const uint8_t() const { return **this; }

^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM/EEPROM.h:92:26: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

operator const int() const { return index; }

^

enterprise_program_6:20: error: 'LedFader' does not name a type

LedFader impulseredFader (ImpulseredPin, 0, 40, 3000, false, true);

^

enterprise_program_6:21: error: 'LedFader' does not name a type

LedFader impulseorangeFader (ImpulseorangePin, 0, 40, 3000, false, true);

^

enterprise_program_6:22: error: 'LedFader' does not name a type

LedFader deflectororangeFader (DeflectororangePin, 0, 40, 3000, false, true);

^

enterprise_program_6:23: error: 'LedFader' does not name a type

LedFader deflectorblueFader (DeflectorbluePin, 0, 40, 3000, false, true);

^

enterprise_program_6:24: error: 'LedFader' does not name a type

LedFader nacellsvioletFader (NacellsvioletPin, 0, 40, 3000, false, true);

^

enterprise_program_6:25: error: 'LedFader' does not name a type

LedFader nacellsblueFader (NacellsbluePin, 0, 40, 3000, false, true);

^

enterprise_program_6:28: error: 'LedFlasher' does not name a type

LedFlasher strobes (StrobesPin, 900, 100, false);

^

enterprise_program_6:29: error: 'LedFlasher' does not name a type

LedFlasher navigation (NavigationPin, 2900, 100, false);

^

C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino: In function 'void setup()':

enterprise_program_6:80: error: 'impulseorangeFader' was not declared in this scope

impulseorangeFader.begin ();

^

enterprise_program_6:81: error: 'impulseredFader' was not declared in this scope

impulseredFader.begin ();

^

enterprise_program_6:82: error: 'deflectororangeFader' was not declared in this scope

deflectororangeFader.begin ();

^

enterprise_program_6:83: error: 'deflectorblueFader' was not declared in this scope

deflectorblueFader.begin ();

^

enterprise_program_6:84: error: 'nacellsvioletFader' was not declared in this scope

nacellsvioletFader.begin ();

^

enterprise_program_6:85: error: 'nacellsblueFader' was not declared in this scope

nacellsblueFader.begin ();

^

enterprise_program_6:86: error: 'strobes' was not declared in this scope

strobes.begin ();

^

enterprise_program_6:87: error: 'navigation' was not declared in this scope

navigation.begin ();

^

C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino: In function 'void doStateChange()':

enterprise_program_6:112: error: 'deflectororangeFader' was not declared in this scope

deflectororangeFader.on();

^

enterprise_program_6:117: error: 'impulseorangeFader' was not declared in this scope

impulseorangeFader.on();

^

enterprise_program_6:122: error: 'nacellsvioletFader' was not declared in this scope

nacellsvioletFader.on();

^

enterprise_program_6:132: error: 'strobes' was not declared in this scope

strobes.on();

^

enterprise_program_6:137: error: 'navigation' was not declared in this scope

navigation.on();

^

enterprise_program_6:154: error: 'impulseredFader' was not declared in this scope

impulseredFader.on();

^

enterprise_program_6:159: error: 'deflectorblueFader' was not declared in this scope

deflectorblueFader.off();

^

enterprise_program_6:169: error: 'nacellsblueFader' was not declared in this scope

nacellsblueFader.off();

^

C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino:95:10: warning: enumeration value 'wantDeflectorblueoff' not handled in switch [-Wswitch]

switch (state)

^

C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino:95:10: warning: enumeration value 'wantNacellsblueoff' not handled in switch [-Wswitch]

C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino: In function 'void loop()':

enterprise_program_6:244: error: 'impulseorangeFader' was not declared in this scope

impulseorangeFader.update ();

^

enterprise_program_6:245: error: 'impulseredFader' was not declared in this scope

impulseredFader.update ();

^

enterprise_program_6:246: error: 'deflectororangeFader' was not declared in this scope

deflectororangeFader.update ();

^

enterprise_program_6:247: error: 'deflectorblueFader' was not declared in this scope

deflectorblueFader.update ();

^

enterprise_program_6:248: error: 'nacellsvioletFader' was not declared in this scope

nacellsvioletFader.update ();

^

enterprise_program_6:249: error: 'nacellsblueFader' was not declared in this scope

nacellsblueFader.update ();

^

enterprise_program_6:250: error: 'navigation' was not declared in this scope

navigation.update ();

^

enterprise_program_6:251: error: 'strobes' was not declared in this scope

strobes.update ();

^

In file included from C:\Users\whyno_000\Documents\Arduino\libraries\LEDFader/LEDFlasher.h:13:0,

from C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino:2:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM/EEPROM.h: At global scope:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM/EEPROM.h:145:20: warning: 'EEPROM' defined but not used [-Wunused-variable]

static EEPROMClass EEPROM;

^

Using library LEDFader in folder: C:\Users\whyno_000\Documents\Arduino\libraries\LEDFader (legacy)
Using library EEPROM at version 2.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM
exit status 1
'LedFader' does not name a type

If i am correct most of my issues will be resolved if i get the correct files.

Any help would be great!

Edited by Ominex
Link to post
Share on other sites
  • 2 weeks later...

You can find what you need here.

https://github.com/wilsonb/arduino/tree/master/libraries

This design was using the ATTINY 2313 which has 2K of memory which wasn't large enough for the entire program. I went with the ATTINY4313. It is the same except for 4K.

I've just recently began using Arduinos And these Tiny chips. I haven't been able to figure out why the "Pin in Code" is different from the Chip pins.

Link to post
Share on other sites
  • 2 weeks later...

Hey guys. Im gonna ask some fairly dumb questions but please bear with me as i am learning all of this from the ground up.

First this link http://sdrv.ms/10XPJWh is no longer available. Do you know what it was and where i can get it?

I also need the LEDflasher.h and LEDfader.h files. I found some via Google but they are giving me errors.

Here is a copy of the errors im getting.

Arduino: 1.6.6 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware "C:\Program Files (x86)\Arduino\hardware" -tools "C:\Program Files (x86)\Arduino\tools-builder" -tools "C:\Program Files (x86)\Arduino\hardware\tools\avr" -built-in-libraries "C:\Program Files (x86)\Arduino\libraries" -libraries "C:\Users\whyno_000\Documents\Arduino\libraries" -fqbn=arduino:avr:uno -ide-version=10606 -build-path "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp" -warnings=all -prefs=build.warn_data_percentage=75 -verbose "C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino"

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware "C:\Program Files (x86)\Arduino\hardware" -tools "C:\Program Files (x86)\Arduino\tools-builder" -tools "C:\Program Files (x86)\Arduino\hardware\tools\avr" -built-in-libraries "C:\Program Files (x86)\Arduino\libraries" -libraries "C:\Users\whyno_000\Documents\Arduino\libraries" -fqbn=arduino:avr:uno -ide-version=10606 -build-path "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp" -warnings=all -prefs=build.warn_data_percentage=75 -verbose "C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino"

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp"

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp"

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp"

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp"

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "C:\Users\whyno_000\Documents\Arduino\libraries\LEDFader\Curve.cpp"

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "C:\Users\whyno_000\Documents\Arduino\libraries\LEDFader\LEDFader.cpp"

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "C:\Users\whyno_000\Documents\Arduino\libraries\LEDFader\LEDflasher.cpp"

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp"

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp"

"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino2/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\preproc\ctags_target.cpp"

"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino2/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\preproc\ctags_target.cpp"

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM" "-IC:\Users\whyno_000\Documents\Arduino\libraries\LEDFader" "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp" -o "C:\Users\WHYNO_~1\AppData\Local\Temp\builde6f1f931c989d8730135996ca613b20f.tmp\sketch\enterprise_program_6.ino.cpp.o"

In file included from C:\Users\whyno_000\Documents\Arduino\libraries\LEDFader/LEDFlasher.h:13:0,

from C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino:2:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM/EEPROM.h:43:30: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

operator const uint8_t() const { return **this; }

^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM/EEPROM.h:92:26: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

operator const int() const { return index; }

^

enterprise_program_6:20: error: 'LedFader' does not name a type

LedFader impulseredFader (ImpulseredPin, 0, 40, 3000, false, true);

^

enterprise_program_6:21: error: 'LedFader' does not name a type

LedFader impulseorangeFader (ImpulseorangePin, 0, 40, 3000, false, true);

^

enterprise_program_6:22: error: 'LedFader' does not name a type

LedFader deflectororangeFader (DeflectororangePin, 0, 40, 3000, false, true);

^

enterprise_program_6:23: error: 'LedFader' does not name a type

LedFader deflectorblueFader (DeflectorbluePin, 0, 40, 3000, false, true);

^

enterprise_program_6:24: error: 'LedFader' does not name a type

LedFader nacellsvioletFader (NacellsvioletPin, 0, 40, 3000, false, true);

^

enterprise_program_6:25: error: 'LedFader' does not name a type

LedFader nacellsblueFader (NacellsbluePin, 0, 40, 3000, false, true);

^

enterprise_program_6:28: error: 'LedFlasher' does not name a type

LedFlasher strobes (StrobesPin, 900, 100, false);

^

enterprise_program_6:29: error: 'LedFlasher' does not name a type

LedFlasher navigation (NavigationPin, 2900, 100, false);

^

C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino: In function 'void setup()':

enterprise_program_6:80: error: 'impulseorangeFader' was not declared in this scope

impulseorangeFader.begin ();

^

enterprise_program_6:81: error: 'impulseredFader' was not declared in this scope

impulseredFader.begin ();

^

enterprise_program_6:82: error: 'deflectororangeFader' was not declared in this scope

deflectororangeFader.begin ();

^

enterprise_program_6:83: error: 'deflectorblueFader' was not declared in this scope

deflectorblueFader.begin ();

^

enterprise_program_6:84: error: 'nacellsvioletFader' was not declared in this scope

nacellsvioletFader.begin ();

^

enterprise_program_6:85: error: 'nacellsblueFader' was not declared in this scope

nacellsblueFader.begin ();

^

enterprise_program_6:86: error: 'strobes' was not declared in this scope

strobes.begin ();

^

enterprise_program_6:87: error: 'navigation' was not declared in this scope

navigation.begin ();

^

C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino: In function 'void doStateChange()':

enterprise_program_6:112: error: 'deflectororangeFader' was not declared in this scope

deflectororangeFader.on();

^

enterprise_program_6:117: error: 'impulseorangeFader' was not declared in this scope

impulseorangeFader.on();

^

enterprise_program_6:122: error: 'nacellsvioletFader' was not declared in this scope

nacellsvioletFader.on();

^

enterprise_program_6:132: error: 'strobes' was not declared in this scope

strobes.on();

^

enterprise_program_6:137: error: 'navigation' was not declared in this scope

navigation.on();

^

enterprise_program_6:154: error: 'impulseredFader' was not declared in this scope

impulseredFader.on();

^

enterprise_program_6:159: error: 'deflectorblueFader' was not declared in this scope

deflectorblueFader.off();

^

enterprise_program_6:169: error: 'nacellsblueFader' was not declared in this scope

nacellsblueFader.off();

^

C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino:95:10: warning: enumeration value 'wantDeflectorblueoff' not handled in switch [-Wswitch]

switch (state)

^

C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino:95:10: warning: enumeration value 'wantNacellsblueoff' not handled in switch [-Wswitch]

C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino: In function 'void loop()':

enterprise_program_6:244: error: 'impulseorangeFader' was not declared in this scope

impulseorangeFader.update ();

^

enterprise_program_6:245: error: 'impulseredFader' was not declared in this scope

impulseredFader.update ();

^

enterprise_program_6:246: error: 'deflectororangeFader' was not declared in this scope

deflectororangeFader.update ();

^

enterprise_program_6:247: error: 'deflectorblueFader' was not declared in this scope

deflectorblueFader.update ();

^

enterprise_program_6:248: error: 'nacellsvioletFader' was not declared in this scope

nacellsvioletFader.update ();

^

enterprise_program_6:249: error: 'nacellsblueFader' was not declared in this scope

nacellsblueFader.update ();

^

enterprise_program_6:250: error: 'navigation' was not declared in this scope

navigation.update ();

^

enterprise_program_6:251: error: 'strobes' was not declared in this scope

strobes.update ();

^

In file included from C:\Users\whyno_000\Documents\Arduino\libraries\LEDFader/LEDFlasher.h:13:0,

from C:\Users\whyno_000\Documents\Arduino\enterprise_program_6\enterprise_program_6.ino:2:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM/EEPROM.h: At global scope:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM/EEPROM.h:145:20: warning: 'EEPROM' defined but not used [-Wunused-variable]

static EEPROMClass EEPROM;

^

Using library LEDFader in folder: C:\Users\whyno_000\Documents\Arduino\libraries\LEDFader (legacy)

Using library EEPROM at version 2.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM

exit status 1

'LedFader' does not name a type

If i am correct most of my issues will be resolved if i get the correct files.

Any help would be great!

You want library <LedFlasher.h> and <LedFader.h> . You can download it from the Gammon forum here

http://www.gammon.com.au/blink

When you get to the page dowmload the two Zip files . And try the two example sketchs

Edited by Richosbrit
Link to post
Share on other sites
  • 1 month later...

Been playing with this again after having to recode alot of work after loosing my original files.

anyway im getting the following errors and not sure what they are babbling on about, anyone have some insight on this.

Enterprise_D_v1.ino:31:42: error: no matching function for call to ‘LedFlasher::LedFlasher(const byte&)’
Enterprise_D_v1.ino:31:42: note: candidates are:
In file included from Enterprise_D_v1.ino:1:0:
/home/chris/sketchbook/libraries/LED_flasher/LedFlasher.h:10:5: note: LedFlasher::LedFlasher(byte, long unsigned int, long unsigned int, bool)
     LedFlasher (const byte pin, const unsigned long timeOff, const unsigned long timeOn, const bool active = true);
     ^
/home/chris/sketchbook/libraries/LED_flasher/LedFlasher.h:10:5: note:   candidate expects 4 arguments, 1 provided
/home/chris/sketchbook/libraries/LED_flasher/LedFlasher.h:5:7: note: LedFlasher::LedFlasher(const LedFlasher&)
 class LedFlasher 
       ^
/home/chris/sketchbook/libraries/LED_flasher/LedFlasher.h:5:7: note:   no known conversion for argument 1 from ‘const byte {aka const unsigned char}’ to ‘const LedFlasher&’
Enterprise_D_v1.ino:31:51: error: expected unqualified-id before numeric constant
Link to post
Share on other sites

Your error message is basically saying your code calling LedFlasher() is not finding an appropriate function with parameters matching your functional call. There are a few LedFlasher functions, but none have the correct parameter type. I suspect you have been defining some new variables (const byte) when it expects another type of parameter. Check where you define the variable you are passing as a parameter - does the type match the one the function requires?

Hope that makes some sense...not done any Arduino programming for a while.

anthony

Link to post
Share on other sites

it makes sense just not sure how to sort it.

this is the library being used.

#pragma once
  
#include <Arduino.h>

class LedFlasher 
  {
  public:

    // constructor
    LedFlasher (const byte pin, const unsigned long timeOff, const unsigned long timeOn, const bool active = true);
    
    void begin ();
    void update ();
    void on ();
    void off ();
    bool isOn () const;
 
   private:
     const byte pin_;
     const unsigned long timeOff_;
     const unsigned long timeOn_;
     
     bool active_;
     
     unsigned long currentInterval_;  // time till we change state
     unsigned long startTime_;        // when we last changed state
     
  };  // end of LedFlasher class

unless im missing something obvious it looks okay?

Link to post
Share on other sites

Sorry, did not see your reply until this evening.

OK - so the LEDFlasher class has 4 parameters. The compiler seems to think you tried to call it with one parameter instead of 4. Check the first line of the error message - that should indicate where the incorrect call was made.

Link to post
Share on other sites
  • 8 months later...

Im having real problems getting this to run.I have downloaded both versions of LEDFader and LEDFlasher from 

https://github.com/wilsonb/arduino/tree/master/libraries and  http://www.gammon.com.au/blink  both files give me error responses ,the github versions actually give me 4 x A4 sheets full of errors basically the errors just keep repeating for every instance were the LEDFader  is used I will post up a small portion of the error:

 

Arduino: 1.6.8 (Windows 7), Board: "Arduino/Genuino Uno"

enterprise_program_6:22: error: no matching function for call to 'LEDFader::LEDFader(const byte&, int, int, int, bool, bool)'

 LEDFader impulseredFader      (ImpulseredPin,      0,   40,  3000,   false,  true);

                                                                                  ^

C:\Users\mark\1350 refit\enterprise_program_6\enterprise_program_6.ino:22:82: note: candidates are:

In file included from C:\Users\mark\1350 refit\enterprise_program_6\enterprise_program_6.ino:3:0:

C:\Program Files (x86)\Arduino\libraries\LEDFader/LEDFader.h:34:5: note: LEDFader::LEDFader(uint8_t)

     LEDFader(uint8_t pwm_pin=0);

     ^

C:\Program Files (x86)\Arduino\libraries\LEDFader/LEDFader.h:34:5: note:   candidate expects 1 argument, 6 provided

C:\Program Files (x86)\Arduino\libraries\LEDFader/LEDFader.h:17:7: note: constexpr LEDFader::LEDFader(const LEDFader&)

 class LEDFader {

       ^

C:\Program Files (x86)\Arduino\libraries\LEDFader/LEDFader.h:17:7: note:   candidate expects 1 argument, 6 provided

C:\Program Files (x86)\Arduino\libraries\LEDFader/LEDFader.h:17:7: note: constexpr LEDFader::LEDFader(LEDFader&&)

C:\Program Files (x86)\Arduino\libraries\LEDFader/LEDFader.h:17:7: note:   candidate expects 1 argument, 6 provided

enterprise_program_6:23: error: no matching function for call to 'LEDFader::LEDFader(const byte&, int, int, int, bool, bool)'

 LEDFader impulseorangeFader   (ImpulseorangePin,   0,   40,  3000,   false,  true);

                                                                                  ^

I have 4 A4 pages of this I have posted to were it starts to repeat.I have spent 6 days trying to figure out whats up and just keep hitting a dead end so was wondering if someone could just point me in the right direction as to how to fix this.

Thank you in advance for any help or advice given


 

 

 

Link to post
Share on other sites

It's difficult to know what the error might be without the original code to look at as well, can you post that up.

Link to post
Share on other sites
  • 1 month later...

Sorry for the delay in replying my laptop died and all my stuff was on it,I thought it was the charger so I bought a new charger and it turned out to be the battery which I had to save for as I had spent the little cash I had on the charger.Anyway all working again now.

 

The sketch was the original enterprise one posted in this thread.

 

// The Enterprise

#include <LEDFader.h>
#include <LedFlasher.h>

// pin assignments
const byte StrobesPin = 13;
const byte NavigationPin = 12;
const byte DeflectorbluePin = 11;   // PWM
const byte DeflectororangePin = 10;    // PWM
const byte NacellsbluePin = 9;      // PWM
const byte ShuttlebayPin = 8;
const byte DoorsPin = 7;
const byte NacellsvioletPin = 6;   // PWM
const byte ImpulseorangePin = 5;  // PWM
const byte TorpedoPin = 4;
const byte ImpulseredPin = 3;   // PWM
const byte RCSPin = 2; 
const byte CabinPin = 1;

// Faders                           pin           min  max  millis    on?    stop?
LEDFader impulseredFader      (ImpulseredPin,      0,   40,  3000,   false,  true);
LEDFader impulseorangeFader   (ImpulseorangePin,   0,   40,  3000,   false,  true);
LEDFader deflectororangeFader (DeflectororangePin, 0,   40,  3000,   false,  true);
LEDFader deflectorblueFader   (DeflectorbluePin,   0,   40,  3000,   false,  true);
LEDFader nacellsvioletFader   (NacellsvioletPin,   0,   40,  3000,   false,  true);
LEDFader nacellsblueFader     (NacellsbluePin,     0,   40,  3000,   false,  true);

// Flashers                pin          off-time  on-time       on?
LedFlasher strobes    (StrobesPin,        900,       100,     false);
LedFlasher navigation (NavigationPin,     2900,      100,     false);

// states for the state machine
typedef enum
  {
  initialState,
  wantCabin,                 // ALWAYS ON
  wantRCS,                   // ALWAYS ON
  wantNavigation,            // ALWAYS ON
  wantStrobes,               // ALWAYS ON
  wantTorpedostartup,        // ALWAYS ON  
  wantDeflectororangestartup,// Startup mode
  wantShuttleBaystartup,     // Startup mode
  wantImpulseorangestartup,  // Startup mode
  wantNacellvioletstartup,   // Startup mode
  wantDeflectororangeon,     // Impulse mode
  wantDeflectorblueoff,      // Impulse mode
  wantNacellsvioleton,       // Impulse mode
  wantNacellsblueoff,        // Impulse mode
  wantImpulseredon,          // Impulse mode
  wantImpulseorangeoff,      // Impulse mode
  wantShuttleBayon,          // Impulse mode
  wantTorpedoon,             // Impulse mode
  wantDeflectorblueoffreturn,// Impulse mode return
  wantNacellsblueoffreturn,  // Impulse mode return
  wantDeflectorblueon,       // Warp mode
  wantDeflectororangeoff,    // Warp mode
  wantNacellsblueon,         // Warp mode
  wantNacellsvioletoff,      // Warp mode
  wantImpulseorangeon,       // Warp mode
  wantImpulseredoff,         // Warp mode
  wantShuttleBayoff,         // Warp mode
  wantTorpedooff,            // Warp mode
    
  } states;

// state machine variables
states state = initialState;
unsigned long lastStateChange = 0;
unsigned long timeInThisState = 1000;

void setup ()
  {
  pinMode (CabinPin, OUTPUT);
  pinMode (RCSPin, OUTPUT);
  pinMode (ShuttlebayPin, OUTPUT);
  pinMode (NavigationPin, OUTPUT);
  pinMode (StrobesPin, OUTPUT);
  pinMode (TorpedoPin, OUTPUT);
  
  // set up faders, flashers  
  impulseorangeFader.begin ();
  impulseredFader.begin ();
  deflectororangeFader.begin ();
  deflectorblueFader.begin ();
  nacellsvioletFader.begin ();
  nacellsblueFader.begin ();
  strobes.begin ();
  navigation.begin ();
  }  // end of setup
        
void doStateChange ()
  {
  lastStateChange = millis ();    // when we last changed states
  timeInThisState = 1000;         // default one second between states

  switch (state)
   {
    case initialState:
         state = wantCabin;
         break;
         
    case wantCabin:
         digitalWrite (CabinPin, HIGH);
         state = wantRCS;
         break;
         
    case wantRCS:
         digitalWrite (RCSPin, HIGH);
         state = wantDeflectororangestartup;
         break;
         
    case wantDeflectororangestartup:
         deflectororangeFader.on();
         state = wantImpulseorangestartup;
         break;
         
    case wantImpulseorangestartup:
         impulseorangeFader.on();
         state = wantNacellvioletstartup;
         break;
         
    case wantNacellvioletstartup:
         nacellsvioletFader.on();
         state = wantShuttleBaystartup;
         break;
//doors open here         
    case wantShuttleBaystartup:
         digitalWrite (ShuttlebayPin, HIGH);
         state = wantStrobes;
         break;
         
    case wantStrobes:
         strobes.on();
         state = wantNavigation;
         break;
         
    case wantNavigation:
         navigation.on();
         state = wantTorpedostartup;
         break;
         
    case wantTorpedostartup:
         digitalWrite (TorpedoPin, HIGH);
         state = wantImpulseorangeoff;              
         timeInThisState = 600000;
         break;
         
//impulse mode
    case wantImpulseorangeoff:
         impulseorangeFader.off();
         state = wantImpulseredon;
         break;
         
    case wantImpulseredon:
         impulseredFader.on();
         state = wantDeflectorblueoffreturn;
         break;
         
    case wantDeflectorblueoffreturn:
         deflectorblueFader.off();
         state = wantDeflectororangeon;
         break;
         
    case wantDeflectororangeon:
         deflectororangeFader.on();
         state = wantNacellsblueoffreturn;
         break;
         
    case wantNacellsblueoffreturn:
         nacellsblueFader.off();
         state = wantNacellsvioleton;
         break;
         
    case wantNacellsvioleton:
         nacellsvioletFader.on();
         state = wantShuttleBayon;
         break;
//doors need to open here         
    case wantShuttleBayon:
         digitalWrite (ShuttlebayPin, HIGH);
         state = wantTorpedoon;
         break;
         
    case wantTorpedoon:
         digitalWrite (TorpedoPin, HIGH);
         state = wantImpulseredoff;
         
         timeInThisState = 600000;  
         break;
         
//warp mode         
   case wantImpulseredoff:
        impulseredFader.off();
        state = wantImpulseorangeon;
        break;
        
   case wantImpulseorangeon:
        impulseorangeFader.on();
        state = wantDeflectororangeoff;
        break;
        
   case wantDeflectororangeoff:
        deflectororangeFader.off();
        state = wantDeflectorblueon;
        break;
        
   case wantDeflectorblueon:
        deflectorblueFader.on();
        state = wantNacellsvioletoff;
        break;
   
   case wantNacellsvioletoff:
        nacellsvioletFader.off();
        state = wantNacellsblueon;
        break;
        
   case wantNacellsblueon:
        nacellsblueFader.on();
        state = wantShuttleBayoff;
        break;
//doors need to close here        
   case wantShuttleBayoff:
        digitalWrite(ShuttlebayPin, LOW);
        state = wantTorpedooff;
        break;
        
   case wantTorpedooff:
        digitalWrite(TorpedoPin, LOW);
        state = wantImpulseorangeoff;
   timeInThisState = 600000;     
         // what next?
         break;
         
    
         
    }  // end of switch on state
  }  // end of doStateChange


void loop ()
  {
   if (millis () - lastStateChange >= timeInThisState)
     doStateChange ();
   // update faders, flashers
   impulseorangeFader.update ();
   impulseredFader.update ();
   deflectororangeFader.update ();
   deflectorblueFader.update ();
   nacellsvioletFader.update ();
   nacellsblueFader.update ();
   navigation.update ();
   strobes.update ();
  // other stuff here like testing switches
  }  // end of loop

 

 

Any help would be great

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...