-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compilation error with hardware serial #2
Comments
Hi, I just commited a new branch with a templated version of the library. This allows you to inject any Class to be used as the "Serial" class. I adapted the simple_measurement example so it compiles on my side. Maybe you have to specify a different type in . You could try oder <Serial_>. Did this help? |
Hi, thank you! it now compiles and I can load it on my board. I've loaded the simple_measurement and it compiled without changing anything! Now the board correctly triggers the measurement on the ut390b in loop, on the lcd i can see the measurements, but on the serial monitor I always get this:
Another strange thing is that it continues printing also with the ut390b switched off. |
Another thing, my board works at 3.3V. For the communication from ut390 to arduino it should not be a problem, because the 2.7V TX goes inside a 3.3V RX. For the communication from arduino to ut390b I'm still using a voltage divider with equal 10kohm resistor, so the output may be a little too low, but the measurements are triggered, so I think that it should not be a problem.. Thanks again! |
Hi, the library returns -1 if it has problems parsing the answer from the ut390. There can be different ways in which the parsing fails: there can be unexpected characters or it can run into a timeout (when no new data arrives from the serial port). This explains why it keeps printing -1 even if the ut390 is switched off.
|
Hi,
When I send the command *004040#, the ut390b takes the measurement, but the serial monitor prints this (two executions).
So I'm getting the data, but probably not in the right format :) I'l try to investigate on this... |
Hi, |
Here I am again XD please don't hate me. |
I did just add lots of debug outs to that templated_version branch. Every line starting with ">" contains raw data that comes into the Serial port. All the other lines are just "comments" to understand what is going on in the parser. To for debugging you could also set up your loop again and just fake the data that you would expect to come from the UT390B. E.g. a message like Again I could only check that the code compiles, not that it runs! You also owe me now to tell me what project you are using my library for. I am always happy if other people can make use of my work! |
Hi! |
That is great! Have fun then. |
Hi,
I'm trying to use your library with an Adafruit Bluefruit LE Micro, which is very similar to an Arduino Micro. It has a usb serial interface (Serial) and an Hardware UART serial on pins 0,1 (Serial1). I'm trying to compile the simple_measurement example without changing anything, (it already declares Serial1 as the interface for communication with the ut390b), but I get this error on compilation:
I'm sure it is an hardware serial, how can I solve this? Thank you
The text was updated successfully, but these errors were encountered: