Announcement

Collapse
No announcement yet.

Using gauges with uOLED-160-g2

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

  • #31
    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, 02:19 PM.
    Michael

    Comment


    • #32
      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.

      Comment


      • #33
        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, 02:20 PM.
        Michael

        Comment


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

          Comment


          • #35
            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, 06:56 PM.
            Michael

            Comment

            Working...
            X