Announcement

Collapse
No announcement yet.

Where to find library and demo that's work for µVGA II SGC + Arduino

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

  • Where to find library and demo that's work for µVGA II SGC + Arduino

    Hello everybody,

    Before writing this message, I have try plenty of library and demo for Arduino, any doesn't work :

    I tried for example :

    https://github.com/rei-vilo/Serial_LCD
    https://github.com/tklenke/Picaso_SGC
    http://thepotterproject.net/TPPNews/?page_id=39
    http://www.4dsystems.com.au/code/index.php?node=80&id=99
    http://4d.websitetoolbox.com/post/uvga-4d-visi-arduino-car-sensor-5970380

    Many times, I have compilations errors with the serial library, I tried :

    NewsoftSerial 10c and http://arduiniana.org/2011/01/newsoftserial-11-beta/ that where recommanded in the demo without success...

    Typicaly here is an example of error :

    SoftwareSerial.h:95: error: conflicting return type specified for 'virtual void SoftwareSerial::write(uint8_t)'

    I use the latest arduino IDE 1.0.1 with a good Arduino Uno v3 board, my VGA board display it's runtime screen.

    I'm desperate, if someone know a demo that's work...

    Sincerely,

    Laurent

  • #2
    Hello Laurent,

    While none of these libraries for the Arduino are products from 4D Systems, there is one that should work that I know of.

    http://embeddedcomputing.weebly.com/serial-lcd.html

    From the sounds of your error message, it is a problem with the SoftwareSerial library... something I am personally unable to help you with. Have you tried asking on the Arduino forum?

    The first github link you posted, however is where the above website library is stored. So this should work... https://github.com/rei-vilo/Serial_LCD

    I just downloaded the library, placed the folder in my C:\Users\[Username]\My Documents\Arduino\Libraries\ folder
    Opened Arduino 1.01, went File - Examples - Serial_LCD - examples - Gauge_Main
    Selected the Arduino Uno, clicked Compile, and it compiled just fine.

    Regards
    James

    Comment


    • #3


      Tank you a lot James,

      I have deleted all my serial library.

      Now I use an Arduino Mega 2560 board which natively supports four serial ports. I did some tests without any library, just with the datasheet of ÎVGA and it works fine.

      And now, always with the Mega 2560, examples of your link works.

      Thank you very much James.

      Here is the code without library :

      HTML Code:
      void setup(){
        Serial.begin(9600); 
        Serial1.begin(9600); 
          
        Serial1.flush(); 
        delay(1200);      // wait for uVGA to power up
        VGA_sendCommand(0x55); // autobaud - sync the communication speed
        VGA_GetResponse();
        clearScreen();         // clear the screen
        Serial.println("clearScreen");
        
        VGA_sendCommand(0x80); // set background color
        VGA_sendCommand(0x10); // indexed color value for black
        delay(200);
        //VGA_GetResponse();
        Serial.println("Fin background");
        VGA_sendCommand(0x4F); // opaque text
        VGA_sendCommand(0x01); 
        delay(200);
        VGA_GetResponse();
        Serial.println("Fin init screen");
        
        VGA_sendCommand(0x59);
        VGA_sendCommand(0x0C);
        VGA_sendCommand(0x02);
        VGA_GetResponse();
        
        VGA_sendCommand(0x64); 
        VGA_GetResponse();
        
        // Dessine une ligne
        VGA_sendCommand(0x4C); // Commande pour dessiner une ligne (4C)
        VGA_sendCommand(0x00); // X1 bite 1
        VGA_sendCommand(0x00); // X1 bite 2
        VGA_sendCommand(0x00); // X2 bite 1
        VGA_sendCommand(0x00); // X2 bite 2
        VGA_sendCommand(0x00); // Y1 bite 1
        VGA_sendCommand(0x7F); // Y1 bite 2
        VGA_sendCommand(0x00); // Y2 bite 1
        VGA_sendCommand(0x7F); // Y2 bite 2
        VGA_sendCommand(0xFF); // Couleur bite 1
        VGA_sendCommand(0xDD); // Couleur bite 2
        VGA_GetResponse();
        
        // Dessine un rectangle
        VGA_sendCommand(0x72); // Commande pour dessiner un rectangle (4C)
        VGA_sendCommand(0x00); // X1 bite 1
        VGA_sendCommand(0x64); // X1 bite 2
        VGA_sendCommand(0x00); // X2 bite 1
        VGA_sendCommand(0x64); // X2 bite 2
        VGA_sendCommand(0x00); // Y1 bite 1
        VGA_sendCommand(0xC8); // Y1 bite 2
        VGA_sendCommand(0x00); // Y2 bite 1
        VGA_sendCommand(0xC8); // Y2 bite 2
        VGA_sendCommand(0xAA); // Couleur bite 1
        VGA_sendCommand(0xAA); // Couleur bite 2
        VGA_GetResponse();
        
      }
      
      // send instruction to uVGA module
      void VGA_sendCommand(byte command){
        Serial1.write(command);
      }
      
      // get confirmation byte from video module saying it completed drawing
      void VGA_GetResponse(){
        while (!Serial1.available()) {}    // Wait for data avaliable
        int reponse = Serial1.read();                    // burn read incoming byte
        Serial.println(reponse);
      }
      
      // clear screen
      void clearScreen(){
        VGA_sendCommand(0x45); 
        VGA_GetResponse();
      }
      
      void loop(){
      
      }

      Comment


      • #4


        I tried with Arduino Uno again, I have always the same error.

        I think, I have a problem with soft or "virtual" serial port, because Uno board have only one port.

        Mega 2560 board solve me.

        Bye,

        Comment

        Working...
        X