Sign In

Trouble To Connect To Dmd P10

aswano aswanpurnomo@gmail.com Indonesia

Hardware: Arduino Uno Software: C Project To Arduino



Sir can you help me ? how to connect indicator scale with serial port to
arduino and then display to panel p10.
i already tried to connect the indicator scale to arduino and then display
to arduino keypadsheild.
Output serial port from indicator its wn0000.00kg

waiting for your respons.
thank’s

Images

Program





#include
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
#include
const int rxpin1 = 0;
const int txpin1 = 1;
SoftwareSerial Scale(rxpin1, txpin1); // gps device connected to pins 2 and 3
#include
#include //SPI.h must be included as DMD is written by SPI (the IDE complains otherwise)
#include //
#include //
#include “SystemFont5x7.h”
#include “Arial_black_16.h”

//Fire up the DMD library as dmd
#define DISPLAYS_ACROSS 1
#define DISPLAYS_DOWN 1
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN);

String inString = “”; // string to hold input

void ScanDMD() {
dmd.scanDisplayBySPI();
}

void setup()
{
Timer1.initialize( 5000 );
Timer1.attachInterrupt( ScanDMD );
dmd.clearScreen( true );
Scale.begin(9600);
Scale.println(“nnString toInt():”);
Scale.println();
}

String digitke1,digitke2,digitke4,digitke5,digitke6;

void loop() {
lcd.clear();
// Read serial input:
while (Scale.available()>0) {
char inChar = Scale.read();
if(isDigit(inChar)){
// convert the incoming byte to a char
// and add it to the string:
inString += (char)inChar;
}
// if you get a newline, print the string,
// then the string’s value:
if (inChar == ‘n’) {

digitke1 = inString.substring(5, 6);
digitke2 = inString.substring(4, 5);

digitke4 = inString.substring(3, 4);
digitke5 = inString.substring(2, 3);
digitke6 = inString.substring(1, 2);

int x1 = digitke1.toInt();
int x2 = digitke2.toInt();
int x4 = digitke4.toInt();
int x5 = digitke5.toInt();
int x6 = digitke6.toInt();

lcd.print(“weight : “);
lcd.print(x6);
lcd.print(x5);
lcd.print(x4);
lcd.print(“,”);
lcd.print(x2);
lcd.print(x1);
lcd.print(” Kg”);

inString = “”;
delay(80);
}
}
}


Replies

R Avinash
2016-11-15 12:46:37
Please add details about "indicator scale ", its photo, manufacturer name and model number.

Post a reply to aswano

Think you can help aswano ? Then post your thoughts that might help aswano. You will earn a lot of reputation in the technical community.

If your program is in multiple files, then ZIP the entire folder and attach below

Images and Screenshots

These helps other better understand your suggestion.