Mitutoyo Digital Scale Serial Interfacing with Wiznet 5500EVB Pico using Arduino IDE #1169
-
Hi I am currently using a Mitutoyo digital scale via serial interface thru an Arduino UNO to read distance measurements, Thanks to sspence from I am hoping to have this setup with the Wiznet 5500 EVB Pico instead of the UNO using Arduino IDE. I got the code I had for the uno to be compiled and uploaded to the Pico, but it doesn't seem to work at all. Hoping you would have some insights on this matter. This is the code I have from sspence's page. `int req = 5; //mic REQ line goes to pin 5 through q1 (Arduino high pulls request line low) byte mydata[14]; void setup() { Serial.begin(9600); pinMode(req, OUTPUT); pinMode(clk, INPUT_PULLUP); pinMode(dat, INPUT_PULLUP); digitalWrite(req,LOW); // set request at high } void loop() { digitalWrite(req, HIGH); // generate set request mydata[i] = k; } value_int = value_str.toInt(); value = value_int / dpp; if (sign == 0) { digitalWrite(req,LOW); |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 23 replies
-
Please format the cpp code correctly, see here
Not enough info, what's the serial output, what exactly doesn't seem to work? No output at all, wrong output? Onto which pins did you connect the circuit? Whe you use int req = 5; //mic REQ line goes to pin 5 through q1 (Arduino high pulls request line low)
int dat = 2; //mic Data line goes to pin 2
int clk = 3; //mic Clock line goes to pin 3 It's expected to be connected to GP5, GP2, GP3. |
Beta Was this translation helpful? Give feedback.
-
Hi @maxgerhardt Im still a basic beginner with the Pico. How can I send the data acquired via ethernet? I want the data accessed remotely from a computer through the network. |
Beta Was this translation helpful? Give feedback.
-
Hi @maxgerhardt `#include <SPI.h> byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0xA3, 0x12 }; EthernetServer server(23); int req = 5; //mic REQ line goes to pin 5 through q1 (Arduino high pulls request line low) byte mydata[14]; void setup() { Ethernet.init(17); // WIZnet W5100S-EVB-Pico W5500-EVB-Pico Serial.begin(9600); pinMode(req, OUTPUT); pinMode(clk, INPUT_PULLUP); pinMode(dat, INPUT_PULLUP); pinMode(20, OUTPUT); digitalWrite(20, HIGH); //change digitalWrite(req,LOW); // set request at high Ethernet.begin(mac, ip, subnet); server.begin(); delay (100); void loop() { EthernetClient client = server.available(); digitalWrite(req, HIGH); // generate set request for( i = 0; i < 13; i++ ) { mydata[i] = k; } value_int = value_str.toInt(); value = value_int / dpp; if (sign == 0) { } digitalWrite(req,LOW); //EthernetClient client = server.available(); // } }` |
Beta Was this translation helpful? Give feedback.
-
Remove me from this email group immediately. I did not ask to subscribe to
this.
On Fri, Feb 17, 2023 at 5:15 PM Maximilian Gerhardt < ***@***.***> wrote:
You are not managing the connected clients like in the example I linked
you to, so this only works for one loop() iteration. Explicitly, you are
missing the saving the accepted clients into an array, clearing them when
disconnected, and iterating through all connected clients when you want to
send data.
Check out
https://gist.github.com/maxgerhardt/a33206a8e76ee6c0b66d574c4a1ad1e8.
Untested of course.
—
Reply to this email directly, view it on GitHub
<#1169 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFIPHXMDA4BBKMYXCZXK7ELWX72AFANCNFSM6AAAAAAUYGPCQI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
.com>
--
Shala Spence, M.Ed.
NEAAAT Instructional Coach
2018-19 NEAAAT Teacher of the Year
FIRST Robotics Competition Team Lead Coach
#teamNEAAAT
…--
*E-mail correspondence to and from this address is subject to
North Carolina's Public Records Act, N.C. Gen. Stat. Sec. 132, and may be
disclosed to third parties. However, Federal and State law protects
personal health and other information that may be contained in this e-mail
from unauthorized disclosure. If you are not the intended recipient,
please delete this e-mail and any accompanying documents and contact the
sender immediately. Unauthorized disclosure, copying or distribution of
any confidential or privileged content of this e-mail is prohibited.*
|
Beta Was this translation helpful? Give feedback.
-
I do not have a GitHub account.
On Fri, Feb 17, 2023 at 5:19 PM Maximilian Gerhardt < ***@***.***> wrote:
Idk how you got into this thread, since I didn't even quote your username
or something, but just use the unsubscribe link that Github gave you
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFIPHXMDA4BBKMYXCZXK7ELWX72AFANCNFSM6AAAAAAUYGPCQI
—
Reply to this email directly, view it on GitHub
<#1169 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFIPHXLVAZRQXVLVH3JSFKDWX72P5ANCNFSM6AAAAAAUYGPCQI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
.com>
--
Shala Spence, M.Ed.
NEAAAT Instructional Coach
2018-19 NEAAAT Teacher of the Year
FIRST Robotics Competition Team Lead Coach
#teamNEAAAT
…--
*E-mail correspondence to and from this address is subject to
North Carolina's Public Records Act, N.C. Gen. Stat. Sec. 132, and may be
disclosed to third parties. However, Federal and State law protects
personal health and other information that may be contained in this e-mail
from unauthorized disclosure. If you are not the intended recipient,
please delete this e-mail and any accompanying documents and contact the
sender immediately. Unauthorized disclosure, copying or distribution of
any confidential or privileged content of this e-mail is prohibited.*
|
Beta Was this translation helpful? Give feedback.
Please format the cpp code correctly, see here
Not enough info, what's the serial output, what exactly doesn't seem to work? No output at all, wrong output?
Onto which pins did you connect the circuit? Whe you use
It's expected to be connected to GP5, GP2, GP3.