Announcement

Collapse
No announcement yet.

Using gauges with uOLED-160-g2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • michael_4D
    replied
    Hello,

    Unfortunately, the Arduino UNO only has one hardware serial port. If you'd like to use multiple hardware serial ports, you might be better off at using an Arduino Mega which has 3 Hardware serial ports or other arduinos with multiple hardware serial ports.

    Other than that, I think your best option might be to learn to manage your Serial communication traffic similar to the Two Port Receive Sample program.

    Best regards

    Leave a comment:


  • ch varma
    replied
    Sir, thanks for the reply...but still I need to display value in both display and serial monitor...

    Leave a comment:


  • michael_4D
    replied
    Hello,

    As you may know, we're currently using the Arduino uno's only Hardware serial port for error logging.
    If you want, you can use this hardware serial port to talk to your Display or GPS device.

    To use it for your display, you may follow these steps:

    1. On your code, replace SoftwareSerial DisplaySerial (2,3); with #define DisplaySerial Serial
    2. Remove Serial.begin(9600); on your setup so it looks something like this:
    Code:
    void setup()
    {
      ss.begin(GPSBaud);
      Display.TimeLimit4D = 5000 ;
      DisplaySerial.begin(9600) ;
      Display.gfx_ScreenMode(LANDSCAPE);
      Display.SSTimeout(0) ;
      Display.SSSpeed(0) ;
      Display.SSMode(0) ;
      Display.media_Init();
      Display.gfx_Cls();
      delay(1000);
    }
    3. Reconnect your hardware so that:
    Arduino D0 pin-----------------------------------------------------> Display Tx Pin
    Arduino D1 pin ----------------------------------------------------> Display Rx Pin

    GND, Reset, and 5v should remain on their previous position.


    Please note that doing this would remove the error logging function of this program. This means that you will not be seeing anything useful on the Serial monitor. It's also not recommended to open the serial monitor while your Arduino is communicating with the display. Any instance of printing to Serial0 (Serial.print(); ) should be removed from your code.

    You might want to consult this application note as reference for using Serial0 to communicate with the display

    Serial Connection to an Arduino Host
    https://www.4dsystems.com.au/appnote/4D-AN-00092/

    This demo project uses Serial0 for communicating with the Display. You may use this as reference as well.

    Display_print.ino
    https://github.com/4dsystems/Goldelo...play_print.ino

    Best regards,

    Leave a comment:


  • ch varma
    replied
    sir, the below attached code is for LCD basic 16x2 displays...which is working very fine.... but to replicate that GPS based speed, in ur 4d display, its a bit tough....without using multi serial comm, cant i end up using any simple technique... share me any simple links sir...

    Leave a comment:


  • ch varma
    replied
    without using software serial, cant i communicate with ur 4d system display sir????..

    meaning: without using this command : - SoftwareSerial DisplaySerial (2,3);

    Leave a comment:


  • ch varma
    replied
    actually i attached a wrong code....sorry....check this attached code sir, i made it simple....
    Attached Files

    Leave a comment:


  • michael_4D
    replied
    Hello,

    Welcome back!

    I'm not really sure how you're getting the "live!" message since I'm not seeing a Serial.begin() function on your code.

    Also, please note that based on this Arduino reference Article, the SoftwareSerial Library can only handle one port at a time.

    SoftwareSerial
    https://www.arduino.cc/en/Reference/softwareSerial

    Since you're using multiple Software Serial ports, you might be interested in using the listen() function as shown here

    Simple Multiple RX/TX SoftwareSerial?
    https://arduino.stackexchange.com/qu...softwareserial

    Two Port Receive
    https://www.arduino.cc/en/Tutorial/TwoPortReceive

    To ensure that the display has been properly initialized, I moved ss.begin(); to the end of the setup function.

    I hope this helps.

    Best regards,

    Leave a comment:


  • ch varma
    replied
    sir, i was trying to showcase a gps based digital speed value to my 4d display... though gps speed value and gps is working independently and using other lcd display, its not working with my 4d display. plz go through the code that i have shared.

    problems faced: serial moitor showing live! ok.. after that no responce. 4d display not showing any speed value or text.
    Attached Files

    Leave a comment:


  • michael_4D
    replied
    Hello,

    There are multiple ways of doing what you want. In my opinion, the simplest way would be to print it out as a string as we've previously discussed.

    You may find more details on the sample program "Display_print.ino" that could be found under C:\Users\Public\Documents\4D Labs\Goldelox Serial\Arduino\Goldelox_Serial_4DLib\Examples\Display_print.

    It would really be helpful to read and understand the application notes that we provide, this should help you gain a fundamental understanding on how to manipulate our displays.

    Application Notes:
    https://www.4dsystems.com.au/appnotes

    For more information on the Arduino command set, you may visit their Language reference page.

    Arduino Language Reference:
    https://www.arduino.cc/reference/en/

    I hope this helps.

    Best regards,

    Leave a comment:


  • ch varma
    replied
    HI SIR,

    need a code, to display two diff values from two diff sensors in same display, next to each other or through a switch, which will change from screen 1 to 2.

    test example: need to see both engine & vehicle speed from two diff sensors, in the same display either on same screen or by swifting from screen 1 to 2 using a switch


    plz provide me some code for that... thanks

    Leave a comment:


  • michael_4D
    replied
    Hello,

    Similar to this:

    Display.txt_Width(3);
    Display.txt_Heght(3);
    Display.txt_MoveCursor(0,0);
    Display.print(reading)
    You could add Display.txt_FGcolour(color); to change the foreground of the text and txt.BGcolour(color); to change the background of the text.

    You could check Goldelox_Const4D.h at C:\Users\Public\Documents\4D Labs\Goldelox Serial\Arduino\Goldelox_Serial_4DLib (line 505 onwards) for the complete list of 16-bit color constants.
    Click image for larger version  Name:	Capture.PNG Views:	1 Size:	36.5 KB ID:	66483

    Alternatively, you could also enter the hexadecimal color value as the color parameter.

    Display.txt_FGcolour(ALICEBLUE); and Display.txt_FGcolour(0xF7DF); will have the same result.

    To ensure that the "Word Values" are recognized by the Arduino please ensure that Goldelox_Const4D.h is included on your project.

    You could do this by checking if you could see a #include "Goldelox_Const4D.h" on your Arduino program.

    This application note and this Arduino post might provide additional insights.

    You could also check GoldeloxBigDemo.ino at C:\Users\Public\Documents\4D Labs\Goldelox Serial\Arduino\Goldelox_Serial_4DLib\Examples\GoldeloxBigDemo for reference.


    Best regards,
    Last edited by michael_4D; 26th December 2018, 05:56 PM.

    Leave a comment:


  • ch varma
    replied
    sir its working now. like font size, how to change colour of text or digits ??? . i tried in visi environment its not changing

    Leave a comment:


  • michael_4D
    replied
    Hello,

    Have you checked the blog post that I was referring to?

    That website had an example code, have you tried that?

    sir, sorry but i am getting confused due to some errors.
    could you give more details on these errors?

    Are you able to print accurate values on your Serial Monitor?

    If you could print accurate values on your Serial Monitor, the next step for you is to print those same values to your Goldelox display.

    Based on the Application notes the I previously sent, you can print anything on the Goldelox display using the print(); command.

    On the last Arduino program that I sent, there was a line that says Display.print(reading);. To print out whatever your RPM value is, all you need to do is change "reading" to your RPM Value.

    Best regards,
    Last edited by michael_4D; 20th December 2018, 01:20 PM.

    Leave a comment:


  • ch varma
    replied
    sir, sorry but i am getting confused due to some errors. could u share me a complete code, to show digital speed in 4d display using any digital pin of arduino using hall or ir sensor, or what part to modify in existing analogue pin code that you have sent previously.

    Leave a comment:


  • michael_4D
    replied
    Hello,

    If I'm not mistaken, the sample program on the link you sent will only produce a digital output of Hi (1) or Lo (0) right?

    Code:
    void loop() //Measure RPM
    {
    int sig=analogRead(A0); //read raw value of hall sensor
    
    if(sig>refsig) val=HIGH; //convert it to digital 0,1 form
    
    else val=LOW;
    
    if(prev_val==0 && val==1)
    
    { //check for rising edge
    cur_t=micros();
    
    
    Serial.println(1000000*60/(cur_t-t));
    //print the rpm
    t=micros();
    }
    prev_val=val;
    
    }
    Were you having issues with this one? I thought it was giving you a good RPM value.

    If I understand this correctly, this blog post might be more helpful for you.

    Best regards,
    Last edited by michael_4D; 20th December 2018, 01:19 PM.

    Leave a comment:

Working...
X