06-26-2014, 06:45 PM
|
#1
|
On the slippery slope
Join Date: Mar 2014
Location: Austin and Palm Springs
Posts: 3,798
|
Quote:
Originally Posted by Polaris
The MovementCount veritable should definitely be getting set to either openTime or closeTime depending on the button pressing. Maybe I posted the wrong version of the code....like a bone head. I'll have a look through my files when I get home from work.
|
Thanks
I have brain farts all the time
__________________
2004 Boxster S 6 speed - DRL relay hack, Polaris AutoTop DIY
2004 996 Targa Tip
Instructor - San Diego region
2014 Porsche Performance Driving School
2020 BMW X3, 2013 Ram 1500, 2016 Cmax, 2004 F-150 "Big Red"
|
|
|
06-27-2014, 07:26 AM
|
#2
|
Registered User
Join Date: Apr 2013
Location: Springfield, Oregon
Posts: 62
|
well craptastic. Looks like the final version got overwritten with the second to last version. I'll go over the code and figure it out and let you know.
On a side note, they are sending me "another" ftdi friend as it's now been 20 days since I ordered the previous one. Looks like USPS ate it.
|
|
|
06-27-2014, 07:28 AM
|
#3
|
On the slippery slope
Join Date: Mar 2014
Location: Austin and Palm Springs
Posts: 3,798
|
Thanks, I appreciate it
__________________
2004 Boxster S 6 speed - DRL relay hack, Polaris AutoTop DIY
2004 996 Targa Tip
Instructor - San Diego region
2014 Porsche Performance Driving School
2020 BMW X3, 2013 Ram 1500, 2016 Cmax, 2004 F-150 "Big Red"
|
|
|
06-27-2014, 07:47 AM
|
#4
|
Registered User
Join Date: Apr 2013
Location: Springfield, Oregon
Posts: 62
|
I'm pretty sure the last switch statement should just look like:
default: //no movement currently
if(openBtnCount > 0) {
openMode = 1;
movementCount = openTime;
digitalWrite(closeBtnOut, LOW);
digitalWrite(openBtnOut, HIGH);
} else if(closeBtnCount > 0) {
openMode = 2;
movementCount = closeTime;
digitalWrite(closeBtnOut, HIGH);
digitalWrite(openBtnOut, LOW);
} else {
allStop();
}
I'm also pretty sure the "movementCount -= loopInterval;" lines shouldn't be in the case 3 and case 4 and default switches. They are unnecessary in case 3 and 4, and constantly decremented when there is no motion in the default case.
|
|
|
06-27-2014, 08:12 AM
|
#5
|
On the slippery slope
Join Date: Mar 2014
Location: Austin and Palm Springs
Posts: 3,798
|
Quote:
Originally Posted by Polaris
I'm pretty sure the last switch statement should just look like:
default: //no movement currently
if(openBtnCount > 0) {
openMode = 1;
movementCount = openTime;
digitalWrite(closeBtnOut, LOW);
digitalWrite(openBtnOut, HIGH);
} else if(closeBtnCount > 0) {
openMode = 2;
movementCount = closeTime;
digitalWrite(closeBtnOut, HIGH);
digitalWrite(openBtnOut, LOW);
} else {
allStop();
}
I'm also pretty sure the "movementCount -= loopInterval;" lines shouldn't be in the case 3 and case 4 and default switches. They are unnecessary in case 3 and 4, and constantly decremented when there is no motion in the default case.
|
just tried those changes and the output still does not stay high except for the time when the switch is closed, in other words no auto operation.
I am using the onboard LED (pin 13) as the output for testing as it is easier than uploading the code and installing in the car to test
__________________
2004 Boxster S 6 speed - DRL relay hack, Polaris AutoTop DIY
2004 996 Targa Tip
Instructor - San Diego region
2014 Porsche Performance Driving School
2020 BMW X3, 2013 Ram 1500, 2016 Cmax, 2004 F-150 "Big Red"
|
|
|
06-27-2014, 09:08 AM
|
#6
|
Registered User
Join Date: Apr 2013
Location: Springfield, Oregon
Posts: 62
|
do you still have your delay(50) removed?
|
|
|
06-27-2014, 09:09 AM
|
#7
|
Registered User
Join Date: Apr 2013
Location: Springfield, Oregon
Posts: 62
|
...and delay(50) should be delay(loopInterval)
|
|
|
06-27-2014, 09:55 AM
|
#8
|
On the slippery slope
Join Date: Mar 2014
Location: Austin and Palm Springs
Posts: 3,798
|
Quote:
Originally Posted by Polaris
...and delay(50) should be delay(loopInterval)
|
The delay is active
I did add the highlighted lines and it appears to now work.
I do have to install it and see for sure
switch(openMode) { ////0=no auto movement, 1=auto open, 2 = auto close, 3 = manual open, 4 = manual close
case 1: //currently auto-opening
digitalWrite(openBtnOut, HIGH);
movementCount -= loopInterval;
and
case 2: //currently auto-closing
digitalWrite(closeBtnOut, HIGH);
movementCount -= loopInterval;
with those 2 extra lines of code, it does auto open/close and a press of the opposite direction button will immediate stop and a press longer than shortPressInterval of the same direction button will stop it
__________________
2004 Boxster S 6 speed - DRL relay hack, Polaris AutoTop DIY
2004 996 Targa Tip
Instructor - San Diego region
2014 Porsche Performance Driving School
2020 BMW X3, 2013 Ram 1500, 2016 Cmax, 2004 F-150 "Big Red"
|
|
|
06-27-2014, 10:43 AM
|
#9
|
Registered User
Join Date: Apr 2013
Location: Springfield, Oregon
Posts: 62
|
If you are going to write high there, you need to also write low to the other pin so you don't accidentally have both open and close high at the same time...that would be dangerous.
|
|
|
06-27-2014, 12:11 PM
|
#10
|
Registered User
Join Date: Apr 2013
Location: Springfield, Oregon
Posts: 62
|
Ooh! I just found my old Nano with onboard USB. I'll set it up and test the code and add support for the parking break pin, too.
I'm not seeing why you needed to add the lines to case 1 and case 2. The pins get written high in the default case before switching to case 1 or 2. Without the default case writing the pin high, the case 1 or case 2 won't be run until the second time around the loop, 50ms later since the default case is what sets the openMode to 1 or 2.
Last edited by Polaris; 06-27-2014 at 12:15 PM.
|
|
|
06-27-2014, 12:32 PM
|
#11
|
On the slippery slope
Join Date: Mar 2014
Location: Austin and Palm Springs
Posts: 3,798
|
Quote:
Originally Posted by Polaris
Ooh! I just found my old Nano with onboard USB. I'll set it up and test the code and add support for the parking break pin, too.
I'm not seeing why you needed to add the lines to case 1 and case 2. The pins get written high in the default case before switching to case 1 or 2. Without the default case writing the pin high, the case 1 or case 2 won't be run until the second time around the loop, 50ms later since the default case is what sets the openMode to 1 or 2.
|
I was just trying a few things. I am very new to programming these things, so it is highly likely unneeded code. Without the added lines it did not run in auto mode at all. The output was high only as long as the switch was closed. A short push did not enable auto mode.
In any case, I'll wait for you to test, especially with the e brake support
Thanks
__________________
2004 Boxster S 6 speed - DRL relay hack, Polaris AutoTop DIY
2004 996 Targa Tip
Instructor - San Diego region
2014 Porsche Performance Driving School
2020 BMW X3, 2013 Ram 1500, 2016 Cmax, 2004 F-150 "Big Red"
Last edited by JayG; 06-27-2014 at 01:32 PM.
|
|
|
04-23-2019, 12:24 AM
|
#12
|
Registered User
Join Date: Apr 2019
Location: Netherlands
Posts: 1
|
Hi Polaris,
Do you still make them? I would love to order one!
Kind regards,
Rene
|
|
|
06-27-2014, 03:18 PM
|
#13
|
Registered User
Join Date: Apr 2013
Location: Springfield, Oregon
Posts: 62
|
Success!!!
I found the correct final sketch, and I updated it to include a parking brake pin on pin 4.
I'm a little weary about the parking break pin simply because it doesn't require an extra lock-out on the parking brake so it'll operate when somebody presses the button at any speed...in other words, use it at your own risk.
I updated the link to the code in the original post. Also, a side note, the link goes directly to the .ino sketch, but since there is no defined MIME for that extension, it just shows it as text. You should be able to right click on the link to download the actual .ino file directly.
There's supposedly a speed control wire that goes to the stereo, so I may investigate using that to set up a high speed lockout.
|
|
|
06-27-2014, 04:34 PM
|
#14
|
On the slippery slope
Join Date: Mar 2014
Location: Austin and Palm Springs
Posts: 3,798
|
Quote:
Originally Posted by Polaris
Success!!!
I found the correct final sketch, and I updated it to include a parking brake pin on pin 4.
I'm a little weary about the parking break pin simply because it doesn't require an extra lock-out on the parking brake so it'll operate when somebody presses the button at any speed...in other words, use it at your own risk.
I updated the link to the code in the original post. Also, a side note, the link goes directly to the .ino sketch, but since there is no defined MIME for that extension, it just shows it as text. You should be able to right click on the link to download the actual .ino file directly.
There's supposedly a speed control wire that goes to the stereo, so I may investigate using that to set up a high speed lockout.
|
You are a Gentleman and a Scholar
the new code works great! :dance:
THANK YOU!!
do you have instructions for connecting for the pbrake interlock?
speed control would be very cool
__________________
2004 Boxster S 6 speed - DRL relay hack, Polaris AutoTop DIY
2004 996 Targa Tip
Instructor - San Diego region
2014 Porsche Performance Driving School
2020 BMW X3, 2013 Ram 1500, 2016 Cmax, 2004 F-150 "Big Red"
|
|
|
06-27-2014, 04:21 PM
|
#15
|
Registered User
Join Date: Apr 2013
Location: Springfield, Oregon
Posts: 62
|
Of course, like clockwork, the FTDI Friend just showed up in the mail.
|
|
|
06-27-2014, 04:43 PM
|
#16
|
Registered User
Join Date: Apr 2013
Location: Springfield, Oregon
Posts: 62
|
pBreak should be the same circuit as the other output pins and should wire to the non-grounded side of the parking break switch....which will probably be a pain in the butt to get to.
I had a thought about the safety of the parking brake interlock, only make it activate when putting the top down, since you have the extra step of the top latch, but leave the close interlock as is so you have to click the parking brake handle one click manually. That way you don't accidentally close the top while driving down the highway.
|
|
|
06-27-2014, 07:27 PM
|
#17
|
On the slippery slope
Join Date: Mar 2014
Location: Austin and Palm Springs
Posts: 3,798
|
just installed it in my car and it works perfectly
The new code Polaris posted is spot on!
I will look into connecting the p brake later, for now, 1 click is fine
Thanks again Polaris!
BTW, it does not matter which way the transistors are wired as long as you get base correct as they are switching ground
__________________
2004 Boxster S 6 speed - DRL relay hack, Polaris AutoTop DIY
2004 996 Targa Tip
Instructor - San Diego region
2014 Porsche Performance Driving School
2020 BMW X3, 2013 Ram 1500, 2016 Cmax, 2004 F-150 "Big Red"
|
|
|
06-30-2014, 11:59 AM
|
#18
|
Registered User
Join Date: Apr 2012
Location: Riverside, CA
Posts: 1,666
|
I just did a "Tortoise Diff" on the Old vs New code and there are lots of differences so don't even try to cut and paste the fixed sections in place in the old one base on the comments here as you WILL miss something.
Better you just redownload the code from the same Link and save the .ino file with date appended so you can get rid of the old incomplete one.
Just saying to help ensure everyones success.
Kudo's to Polaris for developing this and sharing freely with his fellow enthusiasts.
I'm waiting on the speed line upgrade and then I'll jump in as well.
That would be about number 4 on my list of todo's for the 986
__________________
"It broke because it wants to be Upgraded  "
2012 Porsche Performance Driving School - SanDiego region
2001 Boxster S, Top Speed muffler, (Fred's) Mini Morimotto Projectors, Tarret UDP,
Short Shifter, Touch Screen Dual Din Radio, 03 4 Bow glass Top (DD & Auto-X since May 17,2012)
|
|
|
06-30-2014, 02:29 PM
|
#19
|
On the slippery slope
Join Date: Mar 2014
Location: Austin and Palm Springs
Posts: 3,798
|
Quote:
Originally Posted by jb92563
I just did a "Tortoise Diff" on the Old vs New code and there are lots of differences so don't even try to cut and paste the fixed sections in place in the old one base on the comments here as you WILL miss something.
Better you just redownload the code from the same Link and save the .ino file with date appended so you can get rid of the old incomplete one.
Just saying to help ensure everyones success.
Kudo's to Polaris for developing this and sharing freely with his fellow enthusiasts.
I'm waiting on the speed line upgrade and then I'll jump in as well.
That would be about number 4 on my list of todo's for the 986 
|
Yes, I saw a bunch of differences as well. Polaris mentioned he muust have origionally uploaded one of the earlier code versions from development
As a FYI, if you are looking at the code and have opened teh link before, you should refresh the cache (scrfeen) as you may be looking at the old code\
in the beginning of the code:
#define openBtnOut 2
#define closeBtnOut 3
#define pBrakeOut 4
#define openBtnIn 8
#define closeBtnIn 9
IF pBrakeOut is not defined, it is the old code
JB, I am in N San Diego, so if you need some help, let me know
__________________
2004 Boxster S 6 speed - DRL relay hack, Polaris AutoTop DIY
2004 996 Targa Tip
Instructor - San Diego region
2014 Porsche Performance Driving School
2020 BMW X3, 2013 Ram 1500, 2016 Cmax, 2004 F-150 "Big Red"
|
|
|
07-19-2014, 02:20 AM
|
#20
|
Registered User
Join Date: Apr 2014
Location: Leeds UK
Posts: 105
|
Having decided to have a go at this I have now got all the bits and down loaded the code to the board and about to start the wiring. I laid all components and wire out and planned when they would go, this is where the problems start. It could be me as never done this type of stuff before, but my board seems to be missing a GND and the + - below is a pic of the board. Any help really appreciated
Cheers
David
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
All times are GMT -8. The time now is 06:53 AM.
| |