November 23, 2024, 05:17:49 PM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Program modification request.

Started by Friz, March 30, 2015, 08:32:37 PM

Previous topic - Next topic

Friz

March 30, 2015, 08:32:37 PM Last Edit: March 30, 2015, 08:51:03 PM by Friz
ATTN JonnyMac EFX-TEK,

I require a favor that I hope you can perform.

Please, remove the standby button, standby led/lamp & output function
from the attached program code.
The latter program was provided by you awhile ago and was a
great gift to me.
However, I am planning to isolate the standby control from the
prop2 controller since it will be easier to identify with the power
button that is isolated and on the opposite side of the amplifier
chassis.
Placing the standby button & led next to the power button is better
for visual understanding/use.

Take the time to review the below program and remove all features
that relate to the standby control then recompile and post (file).
In the event a file cannot be attached then the code will be sufficient.
I ask that you perform the above because I don't want to hose it all
up.

Thank you for the email concerning the requirement to post at the forum.

FR  :)

' =========================================================================
'
'   File...... Friz_Relays.BS2
'   Purpose...
'   Author.... JonnyMac, EFX-TEK
'              Copyright (c) 2008 EFX-TEK
'              Some Rights Reserved
'              -- see http://creativecommons.org/licenses/by/3.0/
'   E-mail...
'   Started...
'   Updated... 12 JUL 2008
'
'   {$STAMP BS2}
'   {$PBASIC 2.5}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------


' -----[ Revision History ]------------------------------------------------


' -----[ I/O Definitions ]-------------------------------------------------

Relays          VAR     OUTH
RlyControl     PIN     15                      ' SETUP = DN or removed
RlyStandby     PIN     14                      ' SETUP = DN or removed
RlyClnLead     PIN     13                      ' SETUP = DN or removed
RlySustain     PIN     12                      ' SETUP = DN or removed
RlyStack       PIN     11
RlyBypass      PIN     10
RlyGain2       PIN     9
RlyGain1       PIN     8

Buttons         VAR     INL
NotUsed7       PIN     7
BtnStnadby     PIN     6
BtnClnLead     PIN     5
BtnSustain     PIN     4
BtnStack       PIN     3
BtnBypass      PIN     2
BtnGain2       PIN     1
BtnGain1       PIN     0


' -----[ Constants ]-------------------------------------------------------

Control         CON     %10000000               ' to activate relay control


' -----[ Variables ]-------------------------------------------------------

nBtns           VAR     Byte                    ' new buttons
oBtns           VAR     Byte                    ' old buttons
xBtns           VAR     Byte                    ' changed (0 --> 1) buttons

idx             VAR     Byte                    ' loop controller
lastRelays      VAR     Byte                    ' last relay update
check           VAR     Byte


' -----[ Initialization ]--------------------------------------------------

Reset:
  DIRH = %11111111                              ' make control pins outputs

Lamp_Test:
  Relays = %01111111                            ' lamps only (control = off)
  PAUSE 1000
  Relays = %01011111                            ' toggle clean/lead lamp
  PAUSE 1000
  Relays = %00000000

Load_Last:
  READ Saved_Relays, lastRelays                 ' get saved relays
  Relays = lastRelays | Control                 ' activate relay outputs


' -----[ Program Code ]----------------------------------------------------

Main:
  GOSUB Scan_Buttons                            ' scan buttons

  Relays = Relays ^ xBtns | Control             ' toggle selected outputs
  check = Relays & %00111111                    ' isolate relay bits
  IF (check <> lastRelays) THEN                 ' any changes?
    lastRelays = check                          ' save for next scan
    WRITE Saved_Relays, check                   ' save for power-up
    PAUSE 100
  ENDIF

  GOTO Main


' -----[ Subroutines ]-----------------------------------------------------

Scan_Buttons:
  nBtns = %01111111                             ' assume pressed (7 inputs)
  FOR idx = 1 TO 10
    nBtns = nBtns & INL                         ' scan P0..P6
    PAUSE 5
  NEXT
  xBtns = nBtns ^ oBtns & nBtns                 ' look for 0 --> 1 changes
  oBtns = nBtns                                 ' save for next time
  RETURN


' -----[ User Data ]-------------------------------------------------------

Saved_Relays    DATA    %00000000

JonnyMac

It is far easier to create that to destroy -- that's my opinion, anyway.

Please state what you want the new program to do without reference to the old. Please trust me that this is easier.  And be sure to allow others to give you input. By putting my name on the request, you dis-invite others which closes off opportunities for great input. There are some creative people that frequent our forums and they're very helpful.
Jon McPhalen
EFX-TEK Hollywood Office

Friz

Hi all!  :)

I require 6 functions that will each be activated via six N.O tactile switches.
Each function of the tactile switch will toggle the corresponding 12v (coil) mini relay.

1. Gain1
2. Gain2
3. Effect/Bypass
4. Stack switch = 2spkrs/4spkrs
5. Sustain
6. Clean/Lead


The above functions are switched ON/OFF with a N.O. momentary tactile switch, when the particular function is enabled
a corresponding LED will light to show state of relay.
These six functions require the controller to remember the last known condition of the output (relays) when power is removed
from the controller, when power is cycled back to ON the relays (outputs) will return to their prior condition (state).

Additionally, a led lamp test is performed during first power ON, when the latter is initiated all of the above LEDs will light for 2 seconds to show that
they are operating properly; although, the actual relays (outputs) will not be affected during this lamp test.
Additionally, from a prior code you created (posted) I believe a seventh relay was added for the (lamp test).

The clean/lead feature uses two LEDs, one is green for clean channel while the other is red for lead channel, the latter are also a part of the led lamp test.

Furthermore, the following link is the complete original post created awhile ago using the standby feature of which can hopefully be removed from the new request.
Please, feel free to review the EFX web-link (forum) below to gain the full concept of the original design.
The only removal I require is noted in the beginning of the thread.

Thank you for allowing me to post at your forum, I hope in the future you will begin to sell a touchscreen so I can attempt a conversion from the tactile switches.
In the past I would frequent the Arduino forum but the people associated with the controller all seem very ego heavy and insult a lot, I emailed the owner an asked to be terminated from the forum because of the internet bullying that is so obviously noticed.
Truthfully, I believe the latter group are just frustrated programmers that carry too much pride to ask for help  :-[.


http://www.efx-tek.com/php/smf/index.php?topic=668.msg3590#msg3590

Finally, when time permits I hope the above can be fulfilled.

JonnyMac

Well, I guess it really wasn't very different from the first, was it? Still, I think it's a valuable to express what you want versus what you don't want.

Since P14 came available I'm using that to control the Clean LED (no relay on that). Other than in the lamp test, it should always be in the opposite state to the Lead LED on P13.

Sorry for the delay, I'm still in recovery mode from Transworld and Monsterpalooza.

' =========================================================================
'
'   File...... Friz_Relays_2015.BS2
'   Purpose...
'   Author.... JonnyMac, EFX-TEK
'   E-mail....
'   Started...
'   Updated... 01 APR 2015
'
'   {$STAMP BS2}
'   {$PBASIC 2.5}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------


' -----[ Revision History ]------------------------------------------------


' -----[ I/O Definitions ]-------------------------------------------------

Relays          VAR     OUTH
RlyControl     PIN     15                      ' SETUP = DN or removed
LedClean       PIN     14                      ' SETUP = DN or removed
RlyLead        PIN     13                      ' SETUP = DN or removed
RlySustain     PIN     12                      ' SETUP = DN or removed
RlyStack       PIN     11
RlyBypass      PIN     10
RlyGain2       PIN     9
RlyGain1       PIN     8

Buttons         VAR     INL
NotUsed7       PIN     7
NotUsed6       PIN     6
BtnClnLead     PIN     5
BtnSustain     PIN     4
BtnBypass      PIN     3
BtnStack       PIN     2
BtnGain2       PIN     1
BtnGain1       PIN     0


' -----[ Constants ]-------------------------------------------------------

Control         CON     %10000000               ' to activate relay control


' -----[ Variables ]-------------------------------------------------------

idx             VAR     Byte                    ' loop controller
lastRelays      VAR     Byte                    ' last relay update
check           VAR     Byte
mask            VAR     Byte

nBtns           VAR     Byte                    ' new buttons
oBtns           VAR     Byte                    ' old buttons
xBtns           VAR     Byte                    ' changed (0 --> 1) buttons


' -----[ Initialization ]--------------------------------------------------

Reset:
  OUTH = %00000000 : OUTL = %00000000           ' clear all
  DIRH = %11111111 : DIRL = %00000000           ' set outputs

  GOSUB Lamp_Test

  READ Saved_Relays, lastRelays                 ' get last state
  GOSUB Restore_Relays                          ' sequence relays on


' -----[ Program Code ]----------------------------------------------------

Main:
  GOSUB Scan_Buttons                            ' scan buttons

  Relays = Relays ^ xBtns | Control             ' toggle selected outputs
  LedClean = 1 - RlyLead                        ' update Clean LED
  check = Relays & %00111111                    ' isolate relay bits
  IF (check <> lastRelays) THEN                 ' any changes?
    lastRelays = check                          ' save for next scan
    WRITE Saved_Relays, check                   ' save for power-up
    PAUSE 100
  ENDIF

  GOTO Main

' -----[ Subroutines ]-----------------------------------------------------

Lamp_Test:
  LOW RlyControl                                ' do not activate relays
  Relays = %01111111                            ' lamps
  PAUSE 2000                                    ' hold 2s
  Relays = %00000000                            ' all off
  RETURN

' -------------------------------------------------------------------------

Restore_Relays:
  Relays = %10000000                            ' enable relays
  FOR idx = 0 TO 5                              ' loop through relays
    check = 1 << idx                            ' create mask for channel
    check = lastRelays & check                  ' check on state
    IF (check <> 0) THEN                        ' if on
      Relays = Relays | check                   ' activate relay
      PAUSE(100)                                ' delay to prevent surges
    ENDIF
  NEXT
  LedClean = 1 - RlyLead                        ' update Clean LED
  RETURN

' -------------------------------------------------------------------------

Scan_Buttons:
  nBtns = %00111111                             ' assume pressed (6 inputs)
  FOR idx = 1 TO 10
    nBtns = nBtns & INL                         ' scan P0..P5
    PAUSE 5
  NEXT
  xBtns = nBtns ^ oBtns & nBtns                 ' look for 0 --> 1 changes
  oBtns = nBtns                                 ' save for next time
  RETURN


' -----[ User Data ]-------------------------------------------------------

Saved_Relays    DATA    %00000000
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

QuoteThank you for allowing me to post at your forum, I hope in the future you will begin to sell a touchscreen so I can attempt a conversion from the tactile switches.

That's probably not in our wheelhouse but if you find one you like, we may be able to help you connect one of our controllers to it.


QuoteIn the past I would frequent the Arduino forum but the people associated with the controller all seem very ego heavy and insult a lot, I emailed the owner an asked to be terminated from the forum because of the internet bullying that is so obviously noticed.

Truthfully, I believe the latter group are just frustrated programmers that carry too much pride to ask for help

I'm not a fan of the Arduino -- especially since the Parallax Propeller is so much more powerful and easier to program. That's why we use it in the HC-8+ and AP-16+ which were selected by Legoland for world-wide use in their animatronic displays.

I have noticed that in some forum, you're either one of the cool kids or your not -- in our forums, everybody is cool. I am always surprised that while I've only written a handful of Arudino programs, people still track me down offline for help. Why? Well, I think your not explains it.
Jon McPhalen
EFX-TEK Hollywood Office

Friz

April 01, 2015, 04:39:10 PM #5 Last Edit: April 01, 2015, 05:30:46 PM by Friz
Well, I guess it really wasn't very different from the first, was it? Still, I think it's a valuable to express what you want versus what you don't want.

Since P14 came available I'm using that to control the Clean LED (no relay on that). Other than in the lamp test, it should always be in the opposite state to the Lead LED on P13.


I attached a drawing concerning the above change, can you review the latter carefully to make sure the new wiring is correct.

The LCD is a future concept, I am not really sure how I can integrate the visual information to be easily understandable.

Furthermore, the mistake I made was thinking the arduino forum was the same as the EFX forum, the two are 180 degree apart.
Sadly, even when I view some of the interesting work at Youtube regarding the arduino rarely do I see anyone sharing the code.
The arduino items I have all came from Radio Shack when it was closing (very low cost); a box full of question.

I understand many programmers like to keep the code secret but the whole idea of Arduino is to be open of which they FAIL miserably...

Thank you for the support of which to me is the main variable in purchasing and using the Prop2.

JonnyMac

If you're happy with the old LED setup just leave it as is -- it will work with this program. If you'd rather see both the Clean and Lead LEDs on during the lamp test, then make two copies of the attached circuit, one goes to P13, the other to P14.
Jon McPhalen
EFX-TEK Hollywood Office

Friz

Bravo, your method of both explaining the code (software) in reference to the circuit (hardware) is effortless.
I greatly appreciate the help you provide, having this level of support is very uncommon today.
Additionally, I admire the desire you show regarding all your excellent products!  :)

I have to expand my mind since the products provided by EFX-TEK to the consumer have so many applications.
Hopefully, I can become more creative and find other uses - I surf the forum and read a variety of unique ideas that other people have performed and it is amazing!

Thank you!




JonnyMac

April 02, 2015, 09:36:45 AM #8 Last Edit: April 02, 2015, 09:39:08 AM by JonnyMac
We're happy to help our friends/customers.

Of late we've been deliberately designing our products to be hackable. We started with the power-house HC-8+ controller (used world-wide by Legoland, by other parks, and me helping our Hollywood customers) and are presently putting the final details on the AP-8+ WAV player. Like you, we're creators, hence we want to enable/assist the creation of your dreams.

When you need more horsepower than the Prop-2, the HC-8+ is the way to go. Arduino, arschmino -- it's cute, but doesn't cut it in the real world. Have a look at what I've done with the HC-8+ for Steve Wang and his team at Alliance Studio.

-- http://www.efx-tek.com/php/smf/index.php?topic=2132.0
-- http://www.efx-tek.com/php/smf/index.php?topic=2023.0
-- http://www.efx-tek.com/php/smf/index.php?topic=1943.0
-- http://www.efx-tek.com/php/smf/index.php?topic=1740.0
-- http://www.efx-tek.com/php/smf/index.php?topic=1585.0

All the library code in these displays is available to our customers.
Jon McPhalen
EFX-TEK Hollywood Office

Friz

April 03, 2015, 08:22:25 PM #9 Last Edit: April 04, 2015, 09:21:51 AM by Friz
Attn all,

Earlier in the thread I voiced the future use of a touchscreen to replace the tactile switches.
In all truth I am very satisfied with the tactile switches since they are very reliable.

However, down the road if I plan to try a conversion to a color or non color touchscreen I would want to purchase one that is the most compatible with the Prop2  :-\.
A color touchscreen is not necessary since it would probably require added libraries, the typical mono-chrome (green) type screen would be more than enough; simplicity is the main concern.

Any suggestions?  Please provide a web link along with the reason you believe it will interface to the prop2 with the least amount of problems.

I appreciate all input from the friendly forum  :).

Thank you.

JackMan

Something to consider would be upgrading from the Prop2 to the HC8+. Jon has a new Bluetooth module for controlling the HC8+ with your smartphone or tablet.

Friz

Thank you for the response but I don't even own a cell phone or tablet.

:)


JackMan

Do you live in BEDROCK? Just kidding!!  ;D