Announcement

Collapse
No announcement yet.

I can't get my new 4Duino to display anything

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

  • I can't get my new 4Duino to display anything

    Just received the 4Duino so fresh out of the box. I'm on a Mac so aren't using Workshop4, just the Arduino IDE. I can power up the 4Duino to the splash screen. I opened up the demo sketch, pasted below, and I can compile and upload it to the 4Duino with no problem. When it runs, the splash screen doesn't go away and the led just blinks as per the code in function mycallback. I put a Serial.println(ErrCode) in that function and it outputs ErrCode: 1 to the Serial Monitor. When the program first runs, that Serial Monitor displays ?? (but backwards!).

    I'm at a loss. The pdf for the Picaso serial environment command set doesn't really explain how to get things set up which is why I tried with the example sketch. I've also read through the forum entries to see if anyone has had any similar problems.

    //Simple Demo that demonstrates 'print' and 'println' new functionality.

    Code:
    #define DisplaySerial Serial
    
    //-------Picaso DISPLAYS-------
    
    #include <Picaso_Const4D.h>
    #include <Picaso_Serial_4DLib.h>
    
    //use Serial0 to communicate with the display.
    Picaso_Serial_4DLib Display(&DisplaySerial); 
    
    //---------END-----------------
    
    void setup() {
      //For handling errors
      Display.Callback4D = mycallback ;
      //
      //5 second timeout on all commands  
      Display.TimeLimit4D   = 5000 ;
      Serial.begin(9600) ;
    
      //--------------------------------Optional reset routine-----------------------------------
      //Reset the Display using D4 of the Arduino (if using the new 4D Arduino Adaptor - Rev 2)
      //If using the old 4D Arduino Adaptor (Rev 1), change D4 to D2 below.
      //If using jumper wires, reverse the logic states below. 
      //Refer to the accompanying application note for important information.
      //pinMode(4, OUTPUT);  // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
      //digitalWrite(4, 1);  // Reset the Display via D4
      //delay(100);
      //digitalWrite(4, 0);  // unReset the Display via D4
      //-----------------------------------------END---------------------------------------------
    
      delay (5000); //let the display start up  
    
      Display.gfx_ScreenMode(PORTRAIT);
      //Display.gfx_BGcolour(WHITE) ; //change background color to white
      Display.gfx_Cls();            //clear the screen
    
      char a = 'A';
      char a2 = 'B';
      int b = 1234;
      int b2 = -1234;
      long c = 123456;
      long c2 = -123456;
      String string = "This is string class";
      char charr[30] = "This is const char array";
      float d = 123.456789;
      float d2 = -123.456789;
      float nan = NAN;
      float inf = INFINITY;
      float ovf1 = 5294967040.0;
      float ovf2 = -5294967040.0;  
    
      Display.print(a); Display.print(' ');
      Display.println(a2);
      Display.print(b); Display.print(' ');
      Display.println(b2);
      Display.print(c); Display.print(' ');
      Display.println(c2);
      Display.println("This is String"); 
      Display.println(F("This is Flashstring")); 
      Display.println(string); 
      Display.println(charr);
      Display.println(d,6);
      Display.println(d2, 3);  
      Display.println(nan);
      Display.println(inf);  
      Display.println(ovf1);
      Display.println(ovf2);  
    
    }
    
    void loop() 
    {
    
    }
    
    void mycallback(int ErrCode, unsigned char Errorbyte)
    {
      // Pin 13 has an LED connected on most Arduino boards. Just give it a name
      Serial.print("ErrCode: ");
      Serial.println(ErrCode);
      int led = 13;
      pinMode(led, OUTPUT);
      while(1)
      {
        digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
        delay(200);                // wait for 200 ms
        digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
        delay(200);                // wait for 200 ms
      }
    }

  • #2
    Actually, scrub that. I've finally found out what is wrong: your example code! For anyone else who has issues it uses Serial1 and forget Serial.begin(9600), it should be DisplaySerial.begin(200000). Here's the corrected code below - but perhaps now would be a good time to update that example as I couldn't find anything in the datasheet or Picaso command set pdf.

    Code:
    //Simple Demo that demonstrates 'print' and 'println' new functionality.
    
    #define DisplaySerial Serial1
    
    //-------Picaso DISPLAYS-------
    
    #include <Picaso_Const4D.h>
    #include <Picaso_Serial_4DLib.h>
    
    //use Serial0 to communicate with the display.
    Picaso_Serial_4DLib Display(&DisplaySerial); 
    
    //---------END-----------------
    
    void setup() {
      //For handling errors
      Display.Callback4D = mycallback ;
      DisplaySerial.begin(200000);
    
      //5 second timeout on all commands  
      Display.TimeLimit4D   = 5000 ;
    
    //  Serial.begin(9600) ;
    
      //--------------------------------Optional reset routine-----------------------------------
      //Reset the Display using D4 of the Arduino (if using the new 4D Arduino Adaptor - Rev 2)
      //If using the old 4D Arduino Adaptor (Rev 1), change D4 to D2 below.
      //If using jumper wires, reverse the logic states below. 
      //Refer to the accompanying application note for important information.
      //pinMode(4, OUTPUT);  // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
      //digitalWrite(4, 1);  // Reset the Display via D4
      //delay(100);
      //digitalWrite(4, 0);  // unReset the Display via D4
      //-----------------------------------------END---------------------------------------------
    
      delay (5000); //let the display start up  
    
      Display.gfx_ScreenMode(PORTRAIT);
      //Display.gfx_BGcolour(WHITE) ; //change background color to white
      Display.gfx_Cls();            //clear the screen
    
      char a = 'A';
      char a2 = 'B';
      int b = 1234;
      int b2 = -1234;
      long c = 123456;
      long c2 = -123456;
      String string = "This is string class";
      char charr[30] = "This is const char array";
      float d = 123.456789;
      float d2 = -123.456789;
      float nan = NAN;
      float inf = INFINITY;
      float ovf1 = 5294967040.0;
      float ovf2 = -5294967040.0;  
    
      Display.print(a); Display.print(' ');
      Display.println(a2);
      Display.print(b); Display.print(' ');
      Display.println(b2);
      Display.print(c); Display.print(' ');
      Display.println(c2);
      Display.println("This is String"); 
      Display.println(F("This is Flashstring")); 
      Display.println(string); 
      Display.println(charr);
      Display.println(d,6);
      Display.println(d2, 3);  
      Display.println(nan);
      Display.println(inf);  
      Display.println(ovf1);
      Display.println(ovf2);  
    
    }
    
    void loop() 
    {
    
    }
    
    void mycallback(int ErrCode, unsigned char Errorbyte)
    {
      // Pin 13 has an LED connected on most Arduino boards. Just give it a name
    //  Serial.print("ErrCode: ");
    //  Serial.println(ErrCode);
      int led = 13;
      pinMode(led, OUTPUT);
      while(1)
      {
        digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
        delay(200);                // wait for 200 ms
        digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
        delay(200);                // wait for 200 ms
      }
    }

    Comment


    • #3
      Hello Andrew,

      Welcome to the forum and thanks for the update. You will find many 4Duino examples on the 4Dmakers website

      https://www.4dmakers.net/

      I hope this helps

      Best regards

      Paul

      Comment


      • #4
        Hi Andrew,

        The example you were using is a generic Arduino example included with the Picaso-Serial-Arduino-Library, but we can update it to include a note to state that it may be necessary to use Serial1 if using a 4Duino and some other Arduino types that function better if using an alternative serial port.

        Thanks for pointing this out to us

        Best regards

        Paul

        Comment


        • #5
          Hi Paul,

          Consider it from the consumers’ point of view. I bought a 4Duino - a 100% compatible Arduino device - that to use on the Mac requires the Arduino IDE and use of the Picaso serial command set. So naturally I would pick the Arduino Picaso serial library, not least because it’s the right one to use. There is no information that I could find in the document set on how to use this so it would be easy to assume that the example should work - it is for Arduino and the Picaso serial library. Nothing in the documentation says to use Serial1; nothing in the documentation says to use DisplaySerial.begin(200000). Instead I had to hunt around for 2 hours to piece together snippets of information to finally work this out. All the project examples on 4Duino.com use Workshop 4 and I finally found one with a link that downloaded some files that I could check - the others I tried just opened another window and did nothing. Perhaps I didn’t look hard enough (but feel the love a bit - I’m trying to get started here and it shouldn’t be this hard!) The first impression that is left after using the right library plus what appears to be a good example is that the board is faulty somehow. Just for the sake of some extra bit of documentation in the data sheet or a working example.

          The product is a good one, I like it. The documentation (Datasheet) is very good for what I’ve needed so far. I think you are doing yourselves a disservice by not making it easy for your customers to get up and running and it must be significantly harder for your customers for whom English isn’t their first language.

          If I had to give some feedback it would be:
          • include a miniUSB cable in the starter kit: I know there is info that it doesn’t include it, but it is a starter kit.
          • ensure Big-Demo (??) works - I’ve not tried it but I assume it’s the same issue as the other example - and add information in the Picaso Serial Command PDF that informs users to use it.
          • sell a bezel for it - seriously, I’m sure there is a market for it. I’d have bought one at the same time as the starter kit; I’d still buy one now!
          • test and provide instructions for using Workshop 4 in Wine. I haven’t tried this yet, but on the CodeWeavers/Crossover site the entry for Workshop 4 IDE says it won’t work. I can understand that your Mac base may be too small to justify the porting and supporting of the IDE to MacOS, and I can honestly say I’m ok with that business decision as a customer, so a relatively cheap way of doing this would be doing what is needed for it to work with Wine.
          Anyway, this isn’t a rant, I like the product, it’s just that the out-of-the-box experience isn’t the best.

          Regards,

          Andrew

          Comment


          • #6
            Hi Andrew

            Thank you for the feedback, it is always helpful and welcomed.

            Thank you for your recommendation's about the USB cable, Bezel and supporting the MacOS

            The Picaso Serial library is not specific for the 4Duino and as you have noticed is a general Arduino library for use with many Arduino's The use of Serial0 is not suitable on some Arduino's but I agree, it would be good for us to have easy to find information on how to use the 4Duino from a non Workshop 4 perspective that has information on Serial port use. The 4D Makers website has a few example projects that are not Workshop 4 only and can be used just on the Arduino IDE. I will test the Big Demo for compatibility.

            Many customers have used Workshop 4 on the Mac in the past with great success but we don't have a tutorial for this.

            I am glad you like the 4Duino, it is a very versatile display and I am sure you will enjoy creating may projects with it and sorry to hear your out of box experience wasn't the best.

            Best regards

            Paul

            Comment


            • #7
              I can now confirm that Workshop4 IDE does not work in Crossover (or Wine presumably.) It will install but just errors when launched. I really think that could be a worthwhile investment of time for supporting Mac users.

              Comment

              Working...
              X