Go Down

Topic: Precision check weigher (Read 6 times) previous topic - next topic

PeterH

The page you linked to for the JY-R2T V1.2 RS232 Serial Port Converter says "It is powered through a mini USB port", but you don't appear to be supplying power to the mini USB port.
I only provide help via the forum - please do not contact me for private consultancy.

rmartin

Hi Peter
thanks for your reply
I think that the mini usb is an alternative way to power the shield, I think that I can give 5V in 2 ways...
-in my situation the led on the shield power on, and when I try to send a command the tx led power on...bt I can to read (have one output) the serial message from the wigher
tanks
Fabio

PeterH


I think that the mini usb is an alternative way to power the shield, I think that I can give 5V in 2 ways...


Is there any documentation to support that? How much current does it draw from the 5V supply if powered like that? More importantly, what voltage does it drag the Arduino's 5V supply down to in practice?
I only provide help via the forum - please do not contact me for private consultancy.

rmartin

Hi Peter I found a solution
I try to connect my arduino and shield to a serial COM3 and with another serial converter COM4, I monitor the COM4 and I show that the arduino send correctly the string!!!



This code work!

Code: [Select]

#include <SoftwareSerial.h>

//New serial port for my shield
SoftwareSerial Mx3232Serial =  SoftwareSerial(7, 8);

//variabile
//char EchoChar = 'A';
char Str1[ ] = "s";

//String Str1 = " s";
//String Str1 = String(' s',HEX);


String Buffer; unsigned long T;

void setup()  {
//pin7(RX) Input
pinMode(7, INPUT);
//pin8(TX) Output
pinMode(8, OUTPUT);

Mx3232Serial.begin(9600);

Serial.begin(9600);
}

void loop() {
//leggo dalla seriale(pin7)
//EchoChar = PortaSeriale.read();
//invio il dato letto
Mx3232Serial.print(Str1);

//Serial.println(Mx3232Serial.read());

Buffer = "";
T = millis();

 while (millis() - T < 10)  {         // read all the chars on the serial
   while (Mx3232Serial.available() > 0) {
     Buffer += char(Mx3232Serial.read());
   }
 }
 
 if (Buffer.length() > 0) {           // transmit to Serial Monitor        
   Serial.print(Buffer);
 }

delay(1000);

Serial.print(Str1);

}


Now the problem is, how to send the HEX 01 73 string to my weigher and receive the weight?
If with my serial monitor I send this HEX string it work, with arduino NO!

I try to send this

Code: [Select]
Mx3232Serial.print(0x01,HEX);
Mx3232Serial.print(0x73,HEX);


but dosen't work! Now my question is how to dend in HEX this string?
thanks
Fabio

PaulS

Why are you using print() to send binary data? That is what write() is for. Your value, 0x73, is being converted to a string in HEX format, and that string is being sent to the scale, which, of course, doesn't recognize it.

Go Up