Arduino Forum

Using Arduino => Networking, Protocols, and Devices => Topic started by: wjfisherjr on Oct 13, 2016, 04:47 pm

Title: Serial Current Loop
Post by: wjfisherjr on Oct 13, 2016, 04:47 pm
I am working on a project which uses an Arduino Uno to communicate with a scoreboard. The scoreboard protocol is a current loop so I am using a TTL to RS-232 converter which I can connect to a PC and see the Arduino's output. From the RS-232 converter through a RS-232 to Current Loop converter. The scoreboard needs to see a Hexadecimal output from the Arduino telling the scoreboard to display how many points and timer control. So I have a program that output this but scoreboard is not updating. My question is has anyone done this type of project with any success? Does anyone have any suggestion? Is there an Arduino board to convert TTL to Current Loop? Any help would be great. Thanks.
Title: Re: Serial Current Loop
Post by: pylon on Oct 14, 2016, 05:40 pm
You might use a MIDI shield as MIDI also uses serial communication with current loop. At which current level does your scoreboard operate?
Title: Re: Serial Current Loop
Post by: wjfisherjr on Oct 14, 2016, 08:36 pm
I dont know what current the scoreboard runs at, I can only assume its 20ma.
Title: Re: Serial Current Loop
Post by: Paul_KD7HB on Oct 14, 2016, 09:16 pm
You can surely break the existing current loop and insert a milliamp meter. the marking current should be 20 ma. A remote possibility would be 60 ma, like a really old telletype machine.

Do you know the baud rate of the display and is the Arduino the same? Which device is supplying the current for the current loop? One device or the other must be the supplier.

Paul
Title: Re: Serial Current Loop
Post by: wjfisherjr on Oct 16, 2016, 03:50 am
I know the baud rate is 2400 8,n,1. I ordered a midi shield and will try that and see.
Title: Re: Serial Current Loop
Post by: wjfisherjr on Oct 17, 2016, 08:51 pm
Ok, have a midi shield from linksprite. Any help on where to begin. I have the following sample code and I am trying to covert back to rs-232 using a current loop to rs-232 converter to see results on PC.

/*
 MIDI note player

 This sketch shows how to use the serial transmit pin (pin 1) to send MIDI note data.
 If this circuit is connected to a MIDI synth, it will play
 the notes F#-0 (0x1E) to F#-5 (0x5A) in sequence.


 The circuit:
 * digital in 1 connected to MIDI jack pin 5
 * MIDI jack pin 2 connected to ground
 * MIDI jack pin 4 connected to +5V through 220-ohm resistor
 Attach a MIDI cable to the jack, then to a MIDI synth, and play music.

 created 13 Jun 2006
 modified 13 Aug 2012
 by Tom Igoe

 This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/Midi

 */

void setup() {
  //  Set MIDI baud rate:
  Serial.begin(31250);
}

void loop() {
  // play notes from F#-0 (0x1E) to F#-5 (0x5A):
  for (int note = 0x1E; note < 0x5A; note ++) {
    //Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
    noteOn(0x90, note, 0x45);
    delay(100);
    //Note on channel 1 (0x90), some note value (note), silent velocity (0x00):
    noteOn(0x90, note, 0x00);
    delay(100);
  }
}

//  plays a MIDI note.  Doesn't check to see that
//  cmd is greater than 127, or that data values are  less than 127:
void noteOn(int cmd, int pitch, int velocity) {
  Serial.write(cmd);
  Serial.write(pitch);
  Serial.write(velocity);
}
Title: Re: Serial Current Loop
Post by: wjfisherjr on Nov 01, 2016, 04:38 pm
Any one able to help with this project?
Title: Re: Serial Current Loop
Post by: wjfisherjr on Nov 04, 2016, 03:46 pm
Ok, not having any luck with the Midi Shield. I basically want to be able to transmit the following on a 20ma current loop, if anyone has any experience or can add any helpful points would be great.

df 00 e0 00 e4 00 e8 10 ee 70 f1 70 f5 00 f8 06  ß.à.ä.è.îpñpõ.ø.
fe 7f 81 7f 85 00 88 00 8e 40 90 00 94 6d 98 66  þ….ˆ.Ž@."m˜f
9e 00 a0 00 a4 00 a8 00 ae 00 b0 00 b4 3f b8 3f  ž. .¤.¨.®.°.´?¸?
be 70 c1 70 c5 3f c8 3f ce 45 d0 00 d4 06 d8 00  ¾pÁpÅ?È?ÎEÐ.Ô.Ø.
Above is with the following on controller:
Time: 45:00 score Home: 00 Score Visitor: 00 Period: 1

d8 40 de 00 e0 00 e4 00 e8 10 ee 70 f1 70 f5 00  Ø@Þ.à.ä.è.îpñpõ.
f8 06 fe 7f 81 7f 85 00 88 00 8e 40 90 0f 94 3f  ø.þ….ˆ.Ž@."?
98 5b 9e 00 a0 00 a4 00 a8 00 ae 00 b0 00 b4 3f  ˜[ž. .¤.¨.®.°.´?
b8 3f be 70 c1 70 c5 3f c8 3f ce 20 d0 0f d4 06  ¸?¾pÁpÅ?È?Î Ð.Ô.
Above is with the following on the controller:
Time: 00:20 Score Home: 00 Score Visitor: 00 Period: 1

ce 20 d0 0f d4 06 d8 40 de 01 e0 00 e4 00 e8 10  Î Ð.Ô.Ø@Þ.à.ä.è.
ee 70 f1 70 f5 00 f8 06 fe 7f 81 7f 85 00 88 00  îpñpõ.ø.þ….ˆ.
8e 40 90 0f 94 3f 98 5b 9e 00 a0 00 a4 00 a8 00  Ž@."?˜[ž. .¤.¨.
ae 00 b0 00 b4 3f b8 3f be 70 c1 70 c5 3f c8 3f  ®.°.´?¸?¾pÁpÅ?È?
Above is with the following on the controller:
Time: 00:20 Score Home: 01 Score Visitor: 00 Period: 1
Title: Re: Serial Current Loop
Post by: Paul_KD7HB on Nov 04, 2016, 04:59 pm
You have not answered the question about which device is powering the 20ma current loop! I am assuming the display powers the current loop. A normal 20ma current loop uses an on/off sequence for data. On is marking or zero bit. Off is a space or a 1 bit. This can easily be done with an opto-coupler that will handle 20ma. This would isolate the Arduino from the line. TTL would drive the LED in the opto-coupler.

Paul
Title: Re: Serial Current Loop
Post by: wjfisherjr on Nov 04, 2016, 07:45 pm
Yes the display is powering the current loop. I am using an adapter for the Arduino to get to RS-232 the using an adapter to convert RS-232 to current loop, but this still does not work. Then someone suggest MIDI so I now have a MIDI Shield but can not get either to work. I would prefer to use the RS-232 to current loop adapter. I am just having a problem getting the output right and have no way to test if it is even working. I did try to go through the RS-232 to current loop adapter back through another current loop adapter back to RS-232 to a PC but not getting and output. Thanks for your help.
Title: Re: Serial Current Loop
Post by: Paul_KD7HB on Nov 04, 2016, 08:48 pm
Change the baud rate to the lowest you can go. Use a VOM, or if nothing else a DVM, to see if there is a fluctuation in the RS-232 output. Try pin 3 and then pin 2 to pin 7. You should be able to see movement!

Paul
Title: Re: Serial Current Loop
Post by: wjfisherjr on Feb 07, 2017, 01:12 pm
I am still working on this project with no luck. I did decide to connect controller to pc through current loop converter and see what the RAW data is and this is what I found.

[06]Ø@Þ[00]à[00]ä[00]è[10]îpñpõ[00]ø[06]þ…[00]ˆ[00]Ž@[0F]"?˜[ž[00] [00]¤[00]¨[00]®[00]°[00]´?¸?¾pÁpÅ?È?Î Ð[0F]Ô
[06]Ø@Þ[00]à[00]ä[00]è[10]îpñpõ[00]ø[06]þ…[00]ˆ[00]Ž@[0F]"?˜[ž[00] [00]¤[00]¨[00]®[00]°[00]´?¸?¾pÁpÅ?È?Î Ð[0F]Ô
[06]Ø@Þ[00]à[00]ä[00]è[10]îpñpõ[00]ø[06]þ…[00]ˆ[00]Ž@[0F]"?˜[ž[00] [00]¤[00]¨[00]®[00]°[00]´?¸?¾pÁpÅ?È?Î Ð[0F]Ô
[06]Ø@Þ[00]à[00]ä[00]è[10]îpñpõ[00]ø[06]þ…[00]ˆ[00]Ž@[0F]"?˜[ž[00] [00]¤[00]¨[00]®[00]°[00]´?¸?¾pÁpÅ?È?Î Ð[0F]Ô
[06]Ø@Þ[00]à[00]ä[00]è[10]îpñpõ[00]ø[06]þ…[00]ˆ[00]Ž@[0F]"?˜[ž[00] [00]¤[00]¨[00]®[00]°[00]´?¸?¾pÁpÅ?È?Î Ð[0F]Ô
[06]Ø@Þ[00]à[00]ä[00]è[10]îpñpõ[00]ø[06]þ…[00]ˆ[00]Ž@[0F]"?˜[ž[00] [00]¤[00]¨[00]®[00]°[00]´?¸?¾pÁpÅ?È?Î Ð[0F]Ô

From what I see is ASCII and decimal mixed together. Because I can connect controller output to PC I should be able to get Arduino output connected to scoreboard, I just don't think the data being sent from Arduino is correct. The Arduino is sending all HEX data.

If anyone can make any sense out of this it would be greatly appreciated. Thank You.
Title: Re: Serial Current Loop
Post by: PaulS on Feb 07, 2017, 01:39 pm
Quote
The Arduino is sending all HEX data.
No. The Arduino is sending binary data. The value may be one that has a recognizable character associated with it, when you look at the value in an ASCII table, or it may not.
Title: Re: Serial Current Loop
Post by: wjfisherjr on Feb 15, 2017, 01:35 pm
Ok, does anyone have any clue where i should even start with what the Arduino should be outputing to communicate with my scoreboard.
Title: Re: Serial Current Loop
Post by: rockwallaby on Feb 16, 2017, 12:26 pm
wjfisherjr, it appears you are not really reading what people are suggesting to you, as you seem to ignore what is being said.

Take for example, the last post of PaulS, where he suggests to you that the Arduino is sending data as binary, not as hexadecimal.

Did you go and look at the ASCII table yet, no, well here is a link for you, ASCII Table (http://www.asciitable.com/) ?

I don't know the details of your device and you really haven't provided much to go on.

For example, if you wish to send a number 35 out the serial port for your scoreboard, you will likely need to do the following.
First, realise that the number 35 is made up of two characters, a 3 and a 5.
The number 3 in the ASCII table is 51 decimal, and the number 5 is, you guess it, 53 decimal.
So, if you send using serial.write the value 51 followed by another serial.write with value 53, you may be getting closer.

If in fact you need to send hex, then send the hex codes instead of decimal.

Many years ago, these sort of projects were common place, to work with different serial interfaces.

As Paul_KD7HB suggested to you, you do not need the RS-232 interface together with the RS-232 to current loop converter.
You simply need an opto-coupler set up correctly.
Why not do an online search for digital 20mA current loop circuit ?
It must be your lucky day, here, I did it for you, and this link will tell you much to learn about digital current loops (http://kavina-systems.com/articals/current_loop_app_note.html).
As you will notice, there are even simple schematics based on opto-couplers, just as Paul_KD7HB suggested.

Forget the MIDI interface, it may not provide enough current, maybe as low as 5mA, which will not be enough for the scoreboard I think.
_____________
Paul - VK7KPA
Title: Re: Serial Current Loop
Post by: wjfisherjr on Feb 28, 2017, 02:20 am
Well I stepped away from this project for a while and ready to get back at it. First I would like to apologize to anyone who thought that I was not listening to your replies, when I have and already research all that you are talking about.

The scoreboard I am connecting to is a passive receiver side of the current loop and I am using the B&B converter shown in section 3.0 of your link for digital current loops. I am able to receive the data from the original controller into a PC RS-232 port though this converter. So I just need to flip that and transmit to the scoreboard.

The scoreboard needs the following data:
df 00 e0 00 e4 00 e8 10 ee 70 f1 70 f5 00 f8 06  ß.à.ä.è.îpñpõ.ø.
fe 7f 81 7f 85 00 88 00 8e 40 90 00 94 6d 98 66  þ….ˆ.Ž@."m˜f
9e 00 a0 00 a4 00 a8 00 ae 00 b0 00 b4 3f b8 3f  ž. .¤.¨.®.°.´?¸?
be 70 c1 70 c5 3f c8 3f ce 45 d0 00 d4 06 d8 00  ¾pÁpÅ?È?ÎEÐ.Ô.Ø.

I am not sure if the scoreboard needs the HEX or ASCII or a combination of both.

So today I tried to receive data into the Arduino but no luck. I figured If I could receive the data then I could just duplicate that on the output.

When I am back at work tomorrow I will check my notes and give any more information I think would be relative.
Title: Re: Serial Current Loop
Post by: rockwallaby on Feb 28, 2017, 07:52 am
The data you have is simply a representation of the actual binary data stream shown as both hexadecimal and ASCII, with spaces between each byte.

You need to learn and get clear on how binary and hexadecimal and ASCII and maybe Octal are all used to simply show the same thing in different formats for humans to read. At the root, it is all binary at a specific word size, be that 8 bits or 16 bits or whatever.

I imaging you read in that data stream with some terminal application, which will format up the data stream into hexadecimal and also ASCII which is helpful for finding text sections in binary data.

I think you said the scoreboard wants the data to be sent as hexadecimal, and my experience from using these things twenty or more years ago is that this was the case with the devices I used then.

So, I have taken that data stream of yours and removed all the ASCII and the spaces.
Try sending the following to the scoreboard, using the normal serial.print command.
Code: [Select]
df00e000e400e810ee70f170f500f806fe7f817f850088008e409000946d98669e00a000a400a800ae00b000b43fb83fbe70c170c53fc83fce45d000d406d800

If it wants binary, then send it as binary using the serial.write command.
_____________
Paul - VK7KPA
Title: Re: Serial Current Loop
Post by: wjfisherjr on Mar 02, 2017, 01:47 pm
I spent some time yesterday working on this project and have had some success. I am able to connect my laptop to the current loop converter through serial port and send ASCII characters through Termite Terminal program and the score board works. I am doing some research on the Termite Terminal program to see what it is actually outputting so that I can duplicate on the Arduino.

So when I send this, àäÐ Ô the scoreboard sets timer to 20 sec and score 00.

I am not sure but I believe the Termite program is sending binary but not sure.

If any could shed some light on this would be great.

Thanks
Title: Re: Serial Current Loop
Post by: rockwallaby on Mar 02, 2017, 02:37 pm
So, did you even try what I suggested ?
If you did, what were the results ?
If you did not, why not ?

Again I will say in a loud voice, please go and gain a clear understanding of the relationship between ASCII and Hex and Decimal codes. Here, a standard ASCII table chart for you to study, http://www.asciitable.com/ (http://www.asciitable.com/).

Take for example the very standard letter A, look for it in that table, and you will see it is hexadecimal code 41, as in 0x41, and also it is decimal code 65.

Why, because the letter A is the 65th letter along in the ASCII table and that is also the 0x41 in hex.

_____________
Paul - VK7KPA
Title: Re: Serial Current Loop
Post by: wjfisherjr on Mar 02, 2017, 04:37 pm
rockwallaby

  I am sorry that you feel that I am not listening and don't understand ASCII. I am not an expert but I can read the ASCII chart just fine and have seen it while trying to get this figured out. I did use this chart to get the code I sent in the last reply.

 I did try what you asked and it does not work. From what I can see I have not successfully got the Arduino to connect to scoreboard at all. I say this because if I use the terminal program when I send anything the RX light on the scoreboard is blinking and getting the transmission. I have not had any luck getting anything from Arduino to blink this RX led.

  What I am asking is if the terminal program works I need to duplicate that signal on the arduino and it should work. The program I am using is Termite (https://www.compuphase.com/software_termite.htm#_). I would guess it is ASCII but I am not sure.

  In closing I really appreciate your quick responses and sorry for me sounding alittle dumb but I am new to this and learning and I thought that was what this forum was for.
Title: Re: Serial Current Loop
Post by: rockwallaby on Mar 03, 2017, 02:58 am
wjfisherjr, if, when connected to the computer, the scoreboard receive data LED flashes when the computer sends data, and then when you then connect the scoreboard to the Arduino and send data, the same LED does not flash, then that to me suggests one of two things.
First, the wiring from Arduino to scoreboard is not correct or secondly, the software in terms of sending to the serial port is not correct.

Can you detail how you have the wiring from the Arduino to the scoreboard via the various converters you are using. Please detail this accurately.

Can you post your Arduino code here, making sure you use the code tags, the icon looks like </>

Quote
What I am asking is if the terminal program works I need to duplicate that signal on the arduino and it should work. The program I am using is Termite. I would guess it is ASCII but I am not sure.
What is Termite one might ask. It is a terminal program. What is that used for ? Well traditionally it is used to allow a human to type characters on the keyboard to be sent through to another device to be displayed, typically another computer at a different location, also with a keyboard for bi-directional exchange of keyboard characters. Termite like programs can do many other things as well. So these keyboard characters, how do they get encoded for transmission ? Traditionally ASCII has been common. There are other encoding systems as well.

Keep in mind the actual data being transferred is just a bunch of ones and zeros, which can be written on paper as ones and zeros or as hexadecimal or if the ones and zeros amount to an eight bit word, as an ASCII character, they all represent the same thing for a given data that sits between the start and stop bits in an asynchronous serial transmission.

The other thing to watch with ASCII is how the extended characters are being displayed on the system you have as opposed to how I might have. The characters up to character 127 are standard defined ASCII, with the upper 128 characters dependent on the the system, such as operating system.

So, when you print out those characters that you say make the scoreboard display meaningful information, then you need to know, not what ASCII character that is, but more what ASCII code that is, say in decimal or hexadecimal. To clarify, what position in the ASCII table that character is, for the reasons I mentioned above.

You are not sounding dumb, just that clarity and detail can be important to gain understanding.
You will get it working, I know, but we can help better if you answer all questions and provide clear detail, such as code and your hardware setup.
_____________
Paul - VK7KPA
Title: Re: Serial Current Loop
Post by: wjfisherjr on Mar 03, 2017, 05:45 pm
The connection from the arduino uno to the scoreboard is as follows:

I am using the following adapter to connect to the Arduino pin 1 & 2 for TX and RX to output RS232 Click Here for Info (https://www.amazon.com/gp/product/B00EJ9NAKA/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1). Then that connect to a gender changer and then to a B&B Electronics RS232 to Current Loop Converter (http://www.bb-elec.com/Products/Datasheets/r2_Website-Only_0812DS-pdf.pdf) this then connects to the scoreboard driver boards. Below is the code I am using to test different outputs.

Code: [Select]
//Hockey Version 3.03
int start = 2;
int score1 = 3;
int reset = 4;
int ledRun = 12;

void setup()
{
Serial.begin(2400);
pinMode(ledRun, OUTPUT); //Game Running
pinMode(start, INPUT); //Start Game
pinMode(score1, INPUT); //Score +1
pinMode(reset, INPUT); //Reset Game
digitalWrite(ledRun, HIGH); //Turn on LED
}

void loop()
{

if (digitalRead(score1) == LOW) //When target is hit tell scoreboard
{
  Serial.println("df00e000e400e810ee70f170f500f806fe7f817f850088008e409000946d98669e00a000a400a800ae00b000b43fb83fbe70c170c53fc83fce45d000d406d800");

}

if (digitalRead(start) == LOW) //When start is hit tell scoreboard to start timing
{
  Serial.println("àäÐ Ô");
}

  if (digitalRead(reset) == LOW) //Reset score and timer
{
  Serial.write("");
}
}


That is it.

Thanks
Title: Re: Serial Current Loop
Post by: rockwallaby on Mar 03, 2017, 10:13 pm
wjfisherjr, why Arduino pin 1 and Arduino pin 2, when the UART is on Arduino pins 0 and 1 ?
Also, read the customer reviews on that TTL to RS-232 converter, as many of them find the Tx and Rx pins are labeled incorrectly. Review number 2 clearly explains the details.

Also, you do not detail how you are supplying power to the TTL to RS-232  and also to the Rs-232 to 20mA converters ?

The last thing is that you need to check and confirm the actual RS-232 data transmit line is connected to pin 3 on the RS-232 to 20mA converter. and conversely, that the RS-232 data receive line is connected to pin 2 of the RS-232 to 20mA converter.

The product info for the current converter is good as it has a schematic, but I have little faith in how the DB9 pin out of the TTL to RS-232 converter.

Normally you will need to cross over the transmit and receive lines so that both devices can talk to each other.

Get that sorted and then you can move on to the code, which I think will need some work.
_____________
Paul - VK7KPA
Title: Re: Serial Current Loop
Post by: wjfisherjr on Mar 04, 2017, 01:38 pm
Sorry I meant pins 0 and 1 on the arduino. I am powering the ttl to rs232 converter with the 3.3v and ground from arduino, I also tried it with the 5v output. I have swap the RX and Tx on this converter and still did not work and the Rs232 to current loop converter is powered by an external 12vdc power supply.

I will check the pins on the ttl converter on monday when I am back at work.

Thanks for your help
Title: Re: Serial Current Loop
Post by: wjfisherjr on Mar 06, 2017, 01:53 pm
I checked the TTL to RS232 converter and found Pin 3 on the serial connector goes to pin13 on the MAX3232 which is RIN1 and pin 2 of the serial connector does not ring to anything which is wierd.

  I ordered a new converter and here is info click here (http://www.nulsom.com/datasheet/NS-RS232_en.pdf). When that come in I will try it and see what happens.

Thanks
Title: Re: Serial Current Loop
Post by: wjfisherjr on Mar 10, 2017, 05:55 pm
So new unit works and I am now able to control the scoreboard with the Arduino. I know need some help with my code if possible.

Here is my code:
Code: [Select]

//Hockey Version 3.03
#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // TX, RX

int timer; //scoreboard timer value
int points; //scoreboard points value
int start = 2; //start button input pin
int score1 = 3; //score +1 input pin
int reset = 4; // reset button input pin
int ledRun = 12; //Led showing program is running
int enable = 3; //enable set after start button pressed
int reset2 = 0; //reset after reset is pressed
byte messageTimer[] = {0x00, 0xD4};//Timer output to scoreboard
byte messagePoints[] = {0x00, 0xe0};//Points output to scoreboard

void setup()
{
  mySerial.begin(2400);
  pinMode(ledRun, OUTPUT); //Game Running
  pinMode(start, INPUT); //Start Game
  pinMode(score1, INPUT); //Score +1
  pinMode(reset, INPUT); //Reset Game
  digitalWrite(ledRun, HIGH);
  delay(500);
  digitalWrite(ledRun, LOW);

    // initialize timer1
  noInterrupts();           // disable all interrupts
  TCCR1A = 0;
  TCCR1B = 0;
  TCNT1  = 0;

  OCR1A = 31250;            // compare match register 16MHz/256/2Hz
  TCCR1B |= (1 << WGM12);   // CTC mode
  TCCR1B |= (1 << CS12);    // 256 prescaler
  TIMSK1 |= (1 << OCIE1A);  // enable timer compare interrupt
  interrupts();             // enable all interrupts
 
}

ISR(TIMER1_COMPA_vect)          // timer compare interrupt service routine
{
      if (enable == 0  && timer != 0 && points != 4)
      {
         --timer; //timer -1
         messageTimer[0] = timer; //make timer array first digit = timer
         mySerial.write(messageTimer, sizeof(messageTimer)); //send timer info to scoreboard
      }
}

void loop()
{
 
  if (digitalRead(reset) == LOW)
  {
    digitalWrite(ledRun, LOW); //turn off led
    points = 0x00; //points = 0
    timer = 0x20; //timer = 20
    messageTimer[0] = timer; //make timer array first digit = timer
    messagePoints[0] = points; //make points array first digit = points
    mySerial.write(messageTimer, sizeof(messageTimer)); //send timer info to scoreboard
    mySerial.write(messagePoints, sizeof(messagePoints)); //send points info to scoreboard
    enable = 1; //enable start
    reset2 = 1; //reset set to 1
    delay(1000);
  }
 
  if (digitalRead(start) == LOW && reset2 == 1) //start button pressed
  {
    digitalWrite(ledRun, HIGH); //turn on led
     
    while(reset2 == 1)
    {
      enable = 0;
     
      if (digitalRead(score1) == LOW)
      {
        ++points; //add 1 to points
        messagePoints[0] = points; //make points array first digit = points
        mySerial.write(messagePoints, sizeof(messagePoints)); //send points info to scoreboard
        delay(250);
      }
     
      if (points >= 5 || timer <= 0)
      {
        reset2 = 0;
      }
    }
  }
 
}



I am trying to use a timer interrupt to control the timer but the value is dec and I need it to be hex for the scoreboard to work and I think this is my problem. The timer should just countdown from 20 to 0.

Here is a video of what is happening:
https://www.dropbox.com/s/4y9u0jitdsqjgsc/VID_20170310_095608728.mp4?dl=0
Title: Re: Serial Current Loop
Post by: wjfisherjr on Apr 02, 2017, 03:37 am
I just wanted to say thanks to everyone for the help. My system is up and running.
Title: Re: Serial Current Loop
Post by: seigel on Dec 04, 2017, 09:37 pm
Do you have any final details about your success?  Hardware? Software? Schematics?  Cool tricks?  Thanks!