RegisterSearchFAQMemberlistUsergroupsLog in
Reply to topic Page 1 of 1
Mike Lua Questions
Author Message
Reply with quote
Post Mike Lua Questions 
Figured I would start a thread about programming the Lua commands in my Race Capture Pro MK3. Bare with me I am learning... I have just started reading a book on Lua.

Info: RC Pro MK3 with X2 Shift light. Not an OBD2 car so all my inputs are wired into Analog. ShiftX2 is wired to the RJ45 connector using CAN1. I did update my App in my Windows computer to the newest release and updated the Firmware in the RC MK3 to the 2.15

All I want to verify at this time is the the X2 comes on. I copy and pasted the script for "Disco Demo Light". In the Scripting text there was only 1 line that says,

function onTick () end

Do I leave this or delete it?


_________________
1981 Mustang track car
View user's profile Send private message
Reply with quote
Post  
That is a placeholder for code you want to execute. For example, you might be creating a channel with data from another channel. So you would read the channels, do the math, and write the new channel each Tick event.

Generally to make something happen more than once, there will need to be code within that function.


_________________
David Ferguson
Veracity Racing Data
Autosport Labs Preferred Dealer
https://veracitydata.com
View user's profile Send private message Visit poster's website
Reply with quote
Post  
I'm so new I don't even understand the previous comment.

Regardless.... The X2 does not do anything... not even sure where to go from here. I can double check my wiring just to be sure (already checked several times before install)

Update: So I missed that the RJ45 port does not actually supply a power, even though in pic of the port it says 12v. I was able to get the lights to turn on a run the test pattern with help from Kyle at Sector Purple racing (Race Capture Dealer)

So Ill get back to this in the morn, got to re-route B+


_________________
1981 Mustang track car
View user's profile Send private message
Reply with quote
Post  
OK, Shift X2 now has power. It goes through a light sequence on power up, Red Green Blue run back and fourth, it does this with nothing in the "Scripting" section. If I copy and paste the "disco light" test as is says in the set up instruction, it does not do anything different. I changed it to CAN2 because it says that what all the default script is set to...



Is there a tests I can run to see iof the RC "sees" the X2 on the CAN2 line?


_________________
1981 Mustang track car
View user's profile Send private message
Reply with quote
Post  
CAN Bus Channel 2 Baud rate set to 500k from 250k, now X2 shift lights work.

So much info, such scattered placement...

Finally can start learning Scripting now that it is connected. Its odd that sometimes I write a script change and it does not take? I guess I will stumble through it.


_________________
1981 Mustang track car
View user's profile Send private message
Reply with quote
Post  
A few hints

1. Make sure you always write the configuration to your RCP after making any script changes.

2. Turn on the "poll log" checkbox. Note in the log window whether your script loaded properly. It you have a syntax error your script, you'll see it report a problem that generally identifies the approximate line number in your script with the problem.

3. There are buttons in the scripting page that force a restart of the script (and clear the log window). These can make the startup issues more obvious is your missed the log feedback when the script first starts.

(Sorry I don't have the RCP handy to verify the exact button names in the RCP app. I think the buttons are "run" and "clear" but I may be incorrect.)

Hope that helps

John
Schumacher Taxi # 189

View user's profile Send private message
Reply with quote
Post  
Yup, I see the Write Tab and know to do that. I have saved files and send to my RC dealer for some assistance. I used Poll Log, but when the Baud Rate was wrong i was not able to see the issue in the Poll Log. Yes, there is a Clear and RUN tab. This is all new to me. I loaded the test Script that is on the website and it kind of works, not as I suspect it should from reading the script. Dealer was sending me different Script to try and they were not acting as he thought they would either, he was suspect of a firmware issue??? Ill just keep poking away as I always do. fourms seem pretty dead. Ill post what I learn, maybe it will help someone out one day.

BigLobsterDude wrote:
A few hints

1. Make sure you always write the configuration to your RCP after making any script changes.

2. Turn on the "poll log" checkbox. Note in the log window whether your script loaded properly. It you have a syntax error your script, you'll see it report a problem that generally identifies the approximate line number in your script with the problem.

3. There are buttons in the scripting page that force a restart of the script (and clear the log window). These can make the startup issues more obvious is your missed the log feedback when the script first starts.

(Sorry I don't have the RCP handy to verify the exact button names in the RCP app. I think the buttons are "run" and "clear" but I may be incorrect.)

Hope that helps

John
Schumacher Taxi # 189



_________________
1981 Mustang track car
View user's profile Send private message
Reply with quote
Post  
MikeStang wrote:
. I loaded the test Script that is on the website and it kind of works, not as I suspect it should from reading the script.

... Ill just keep poking away as I always do. fourms seem pretty dead. Ill post what I learn, maybe it will help someone out one day. ...


Sounds like you probably have it working. The "disco light" demo test script just randomly sets colors and turns the 9 the shift leds rapidly on and off -- nothing more. If they're flashing, it's working.

With the new 15.1 firmware you can also automatically load a script (without cut/paste) that gives a better demo of the shift light in action. In the scripting menu, click on the "Preset Button", click browse to download (from the internet) various predefined scripts, and scroll down see the various preset scripts, load it and write the configuration to the RCP. The "shift light in action" demo is about 1/2 down the list.

These scripts work for the X2 and X3 (but of course there's no 7 segment gear display.)

You can use these scripts as is or modify them (like setting shift points) as needed. Make small changes, verify each change is written and starts up correctly (watching the log) and keep backup versions of the scripts in a Notepad editor so you can keep track of things.

FYI - there is also a facebook "Autosport Labs Community" where support is being provided.

John
Schumacher Taxi #189

View user's profile Send private message
Reply with quote
Post  
Thanks, good to know the X2 and X3 script will work together.

I was initially confused because on power up the lights run back and fourth and change color. I now know this is where there is no CAN communication


BigLobsterDude wrote:
MikeStang wrote:
. I loaded the test Script that is on the website and it kind of works, not as I suspect it should from reading the script.

... Ill just keep poking away as I always do. fourms seem pretty dead. Ill post what I learn, maybe it will help someone out one day. ...


Sounds like you probably have it working. The "disco light" demo test script just randomly sets colors and turns the 9 the shift leds rapidly on and off -- nothing more. If they're flashing, it's working.

With the new 15.1 firmware you can also automatically load a script (without cut/paste) that gives a better demo of the shift light in action. In the scripting menu, click on the "Preset Button", click browse to download (from the internet) various predefined scripts, and scroll down see the various preset scripts, load it and write the configuration to the RCP. The "shift light in action" demo is about 1/2 down the list.

These scripts work for the X2 and X3 (but of course there's no 7 segment gear display.)

You can use these scripts as is or modify them (like setting shift points) as needed. Make small changes, verify each change is written and starts up correctly (watching the log) and keep backup versions of the scripts in a Notepad editor so you can keep track of things.

FYI - there is also a facebook "Autosport Labs Community" where support is being provided.

John
Schumacher Taxi #189



_________________
1981 Mustang track car
View user's profile Send private message
Reply with quote
Post  
We have a very basic example of the standard ShiftX3 script also controlling a 2nd ShiftX on a different CAN address. Here's how you could do it:

https://gist.github.com/brentpicasso/eb4fe9847053fcc6140f1b841cf24760


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum