Announcement

Collapse
No announcement yet.

Using gauges with uOLED-160-g2

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

  • michael_4D
    replied
    Hello,

    A sample program for writing to custom digits is discussed in this forum thread (sample program on post #7).

    If you're interested in using custom digits for your project, you might want to read up on that.

    However, if you find that it's too complicated for your skill level, I would suggest using a third party font and printing the sensor value to the display instead.

    You might want to read this application note for a deeper explanation.

    I'm assuming 1000000*60/(cur_t-t) is the rpm value, right? to print that with the sample program I sent, you just need to put that in the place of 'reading'.

    Best regards,
    Attached Files

    Leave a comment:


  • ch varma
    replied
    1. im using hall sensor. just a bare 3 pin magnetic field sensor with vcc, grd & singnal pins.

    2. im getting 4000rpm by just a simple rpm formula

    Leave a comment:


  • ch varma
    replied
    //this code measures the difference between two rising edges of the digitalized signal coming from hall sensor and then prints the rpm.
    //pin A0 is the signal pin


    int refsig=200; //for converting the analog signal coming from hall sensor to digital through Arduino code

    int val; //the digital value of the incoming analog signals

    int prev_val=0;

    unsigned long t,cur_t; //time variables


    void setup()
    {
    Serial.begin(9600);
    pinMode(A0,INPUT);
    }





    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;

    }

    Leave a comment:


  • michael_4D
    replied
    Hello,

    May I know what RPM sensor you're using?

    May I know how you're getting the 4000 value?

    Are you able to print out the sensor value to the Serial monitor? If so, could you please send the Arduino code that you're using to do that?

    I'm sorry if you're having a hard time with our module, we try to provide as much detailed information as we can through our application notes.

    We also have this forum site for customer inquiries and suggestions.

    Best regards,

    Leave a comment:


  • ch varma
    replied
    I think I'm asking more and more. But sorry sir, as I'm a guy with zero knowledge in coding and can't able customize codes as per my requirements. Initially I bought 3 displays of 4d systems thinking that it's just drag-drop-use . But later came to know, it's so tough and no video tutorials are available to that extent.

    Leave a comment:


  • ch varma
    replied
    Thanks sir, I understood how to make 4d gauge widget as a slave to Arduino instructions.. the same I tried with digital numbering gauge, but can't able to display it.

    Is their any sample code, which can display a digital number widgets from Arduino serial monitor to 4d display, as I told u that, my I/p engine rpm signal to Arduino is not analogue, but digital. So need to display digital signal value from 0 to 4000 on 4d display. Kindly, if I have any other sample code, pls share

    Leave a comment:


  • michael_4D
    replied
    Hello,

    First of all, I'm sorry if you got confused with the Rx and Tx lines, but the wiring diagram I sent matches my previous instructions;

    Arduino GND pin -------------------------------------------------> Display GND pin
    Arduino 5V pin ----------------------------------------------------> Display 5V pin
    Arduino D2 pin-----------------------------------------------------> Display Tx Pin
    Arduino D3 pin ----------------------------------------------------> Display Rx Pin
    Arduino D4 pin -------------10K resistor---------------------> Display Reset Pin
    For your first question, The ViSi environment only asks for a uSD card if you've changed something on your graphical layout. If nothing is changed or if you've only changed the coding section, it will not ask for a uSD card, if it does then you could click on 'No Thanks'. If the project is made entirely of 4DGL codes and no graphical layout like some other sample programs, It will also not ask for a uSD card. You could read more about that on this Application Note.

    I experienced an error similar to your attached image when I had some files on my uSD card, what I did was I reformatted my uSD card and when it was completely empty, I just let the RAWcopy.exe do its work. Please also be informed that not all uSD cards are 'compatible' with our products, you could check this forum thread for more information.

    For your second question, you could can just comment out the map function and equate the reading parameter tothe reading of A0, In order for the display to show values from 0 to 4000, you'll need to edit the ViSi graphical layout and change the 'maximum value' parameter of the cool gauge to 4000. More instructions on modifying the cool gauge could be found here.

    A deeper explanation of the map function could be found here.

    If you'd like to know more about using our products, you could try consulting our Application Notes.

    You could also visit the Arduino website for a deeper explanation on some of the commands and functions that I used on the sample program that I sent.

    Best regards,

    Leave a comment:


  • ch varma
    replied
    Thank you sir . After interchanging the Tx , Rx, its working properly now..thanks. also i have two problems:

    1. some times while clicking compile option, its not asking for uSD card and even not showing any loading option and fails to load programme in uSD card. its regularly happening with your gauge code file what u have shared & not with any other sample examples.

    2. i tried to alter your potentiometre code, to show RPM of my engine in digital form. but i cant able to. my arduino displays rpm value from 0 to 4000 on serial monitor. kindly help me with a code that can display rpm of engine in digital widget .


    forgot to tell that, last time you told rx to d3 , tx to d4. thats why i faced some problem.
    Attached Files

    Leave a comment:


  • michael_4D
    replied
    Hello,

    You seem to have the Rx and Tx lines swapped, the yellow wire should be on pin D2 of the Arduino and the Orange wire should be on Pin D3 of the Arduino.
    Click image for larger version  Name:	Wiring.png Views:	1 Size:	484.7 KB ID:	66318
    When using goldelox modules, you're only allowed to use Flash as the program destination this Application Note provide a deeper explanation on that.

    Best regards,
    Last edited by michael_4D; 12 December 2018, 01:35 PM.

    Leave a comment:


  • ch varma
    replied
    https://youtu.be/j4v-717ggsM

    Leave a comment:


  • ch varma
    replied
    sir, same again.. i tried even that... i have attached a video, plz go through it... my two displays,arduino,wiring,10k resistor is perfect . i cross verified many times. my uSD card is 2 gb, which is working good too....... my display scrool shows: spe2 rev 1.3, pmmc rev 2.6,comm 9600 & arduino was set to 9600..


    im having a dought.. in 4d ide settings, generally the programme & widgets data was saved in Flash uSD, can i select RAM option also? & when.. Click image for larger version

Name:	photo.jpg
Views:	135
Size:	2.03 MB
ID:	66311

    Leave a comment:


  • michael_4D
    replied
    Hello,

    That seems really odd, based on the photo you sent, you seem to have wired it correctly.

    Just to be clear, The programs that I sent should've remained untouched except for the Logic change on the reset routine of the Arduino program.

    The SPE splashscreen should appear however, upon uploading the arduino program, that should change into the cool gauge image.

    There could be a couple of seconds of delay before that happens.

    Would it be possible that the wires you used for the Rx and Tx line are having loose connections?

    Is the issue persistent even after multiple power cycles of the arduino?

    I've re-attached the project files that I'm using, these are the same as the first one except for the reset routine on the arduino program.
    Attached Files

    Leave a comment:


  • ch varma
    replied
    sir, still same problem ... as u said, i loaded SPE application after uploading visi project to display & before uploading, arduino code... but still display is not responding to arduino....

    things noticed:

    before, i dont used to load SPE , then just after putting uSd card.. atleast it used to show gauge
    but now after loading SPE, default graphic scrolling text is being shown.. even after inserting uSd card...



    plz help....

    Leave a comment:


  • michael_4D
    replied
    Hello,

    As I've mentioned previously,

    Also, After compiling the ViSi project and saving the graphics files to the SD card, Please reload the SPE program and ensure that 9600 is the default baud rate as shown in the image.
    So here's what you should be doing.

    1.) Compile & upload the ViSi project.
    2.) Reload the SPE Application as described here.
    3.) Connect the Display to the Arduino as you previously did.
    4.) Upload the Arduino program.
    Note: before uploading the Arduino program please check that:
    a.) Your wiring is correct.
    b.) The Reset logic is swapped.
    c.) The parameters of media_SetAdd(); and media_VideoFrame(); are the same on the Arduino and Visi programs.

    I hope this helps.

    Best regards,

    Leave a comment:


  • ch varma
    replied
    sir, i did that jumpers logic states reverse also....but still same problem......

    finally this is how i tried:

    1. i opened ur visi code in 4d ide software & compiled,downloaded in uSD card.
    2. display blinks starting.... & after inserting uSD card, it shows gauge with pointer at 100 + half " starting " text on top left corner.
    3. opened arduino code & checked baud rate match, some command match, reset pin logic state swap etc as u told
    4. before compiling arduino code, done wiring as follows:
    display : arduino
    5v 5v
    grd grd
    reset d4
    tx d2
    rx d3
    5. runned the programme - both before connecting the tx and rx & after tooo

    then following happens in serial monitor :

    live
    point 1
    point 1.5

    specs of my setup:
    1. 10k ohm resistor
    2. arduino uno - 9600 set
    3. 160 g2 goldlex - spe2 -rev-1.3, pmmc rev 2.6,comm 9600 set

    also, i dont dought my arduino and display, as they are running all other serial codes like

    1. big demo
    2. serial print
    3. goldlex visi samples

    sir, plz help.....


    Attached Files

    Leave a comment:

Working...
X