MAGracing Forum

Share your MAGracing with the rest of the world, get inspired and enjoy
It is currently Tue 16. Oct 2018 08:02

All times are UTC




Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Thu 14. Jan 2016 19:03 
Offline

Joined: Mon 9. Nov 2015 11:49
Posts: 153
Location: Norway
Got it !!

Thanks for your advice.

I did not have to use Putty, output came nicely on the Arduino Serial Monitor.

_________________
Racing Regards

Kim K.


Top
 Profile  
 
PostPosted: Fri 15. Jan 2016 05:44 
Offline

Joined: Sat 26. Apr 2014 00:16
Posts: 30
That's great!
What software do you plan on using?


Top
 Profile  
 
PostPosted: Fri 15. Jan 2016 07:07 
Offline

Joined: Mon 9. Nov 2015 11:49
Posts: 153
Location: Norway
I have had a 'talk' with guys at http://www.racecoordinator.net.

He was interested in incorporating MAGracing to their sw.
So now when I have my HW up and running I'll ask him how he's doing.

_________________
Racing Regards

Kim K.


Top
 Profile  
 
PostPosted: Fri 15. Jan 2016 07:51 
Offline

Joined: Sat 26. Apr 2014 00:16
Posts: 30
kiklo wrote:
I have had a 'talk' with guys at http://www.racecoordinator.net.

He was interested in incorporating MAGracing to their sw.


That's good news :)
If you need any help rewriting the Arduino code to e.g. output a different format for the car numbers please let me know. As far as I recall I had to make some optimizations due to timing issues, so the code is not easy to read.


Top
 Profile  
 
PostPosted: Fri 22. Jan 2016 07:36 
Offline

Joined: Mon 9. Nov 2015 11:49
Posts: 153
Location: Norway
Today I got the new Arduino code to be used with RaceCoordinator. Going to be an interesting weekend.
I'd probably have some footage to show tonight.

_________________
Racing Regards

Kim K.


Top
 Profile  
 
PostPosted: Sun 31. Jan 2016 16:15 
Offline

Joined: Mon 9. Nov 2015 11:49
Posts: 153
Location: Norway
As we are working with some IO issues on Arduino and RC I have put up a small table to compaire settings and output:

colum 1
magracing car no from web

colum 2
dip settings 0=low pos, 1=high pos.

colum 3
car no readings in hex from the Arduino (human readable - enabled)

No00 0000 0
No01 0001 8
No02 0010 4
No03 0011 C
No04 0100 2
No05 0101 A
No06 0110 6
No07 0111 E
No08 1000 1
No09 0110 6
No10 1010 5
No11 1011 D
No12 1100 3
No13 1101 B
No14 1110 7
No15 1111 F

_________________
Racing Regards

Kim K.


Top
 Profile  
 
PostPosted: Sun 31. Jan 2016 21:58 
Offline

Joined: Sat 26. Apr 2014 00:16
Posts: 30
kiklo wrote:
colum 1
magracing car no from web

colum 2
dip settings 0=low pos, 1=high pos.

colum 3
car no readings in hex from the Arduino (human readable - enabled)


Yes, the table is correct. What the Arduino sketch does is that it checks a number of pins (by default 0 to 7) and reports any car IDs spotted on those sensors.

When it sends data to the serial port it combines the sensor ID and car ID into one byte because there is a lower risk of communication problems if you only send one byte at a time - you don't have potential for out of sync and you don't need to implement a protocol and so on. Besides, 16 sensors and 16 cars are enough, at least for a proof of concept which is basically what this project was all about :-)

A few examples of what gets returned by the sketch (written in hexadecimal to make the two IDs more visible):
0x00 - sensor ID 0, car ID 0
0x0F - sensor ID 0, car ID 15 (F = 15)
0x47 - sensor ID 4, car ID 7
And so on and so on.

If the "human readable" option is enabled in the sketch two bytes are sent over the serial port which makes it easier to read in a serial monitor.

Race Coordinator (RC) expects some kind of ID to be transmitted and while I do have some code running that responds as it should to commands from RC there are some issues about how to actually use RC's data protocol correctly with MAGracing where the cars are not confined to being in a single lane.


Top
 Profile  
 
PostPosted: Sun 31. Jan 2016 22:31 
Offline

Joined: Sat 26. Apr 2014 00:16
Posts: 30
For those interested in testing here's a simple C# application made with the free version of Visual Studio. It only supports car IDs 0-3, but should show how to work with the serial port and it should be easy to expand it to include more cars, a nicer look and so on.

If you get a lot of "sensor 1, car 0" events change Serial.println to Serial.print in the Arduino sketch or change the event handler in the C# program to read a line and filter out the newline character(s). This is just a quick proof of concept so I didn't want to spend a lot of time on those things.

Enjoy :-)


Attachments:
LapCounterPOC.zip [16.44 KiB]
Downloaded 110 times
Top
 Profile  
 
PostPosted: Mon 1. Feb 2016 21:23 
Offline

Joined: Mon 9. Nov 2015 11:49
Posts: 153
Location: Norway
Hi.

Got some good testing tonight on RC.

Setup : I use 3 sensors on 3 Arduino Digital pins (2,3,4).
Have coded my cars from 0 to 5 (hex wise, from the table above.).


Now running Skjalm cleaned RC.ino code with latest RC we are closer:

Procedure:

starting with car 0, passing all sensors 1,2,3 3,2,1 I get readings on lane 6,5,4 4,5,6 + som one 3

repeating with car 1 same sequens giving same readings.

And so with all cars.

Still som IO issues to clear out but now we have usable readings.

_________________
Racing Regards

Kim K.


Top
 Profile  
 
PostPosted: Sat 20. Feb 2016 14:49 
Offline

Joined: Mon 9. Nov 2015 11:49
Posts: 153
Location: Norway
Now we are counting !!
RaceCoordinatorDigital is live.
Thanks a lot to Dave at RC, and Skjam who did the Ardiono code and boardlayout !!


_________________
Racing Regards

Kim K.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group