Help in processing...

Discussion in 'Programmer's Corner' started by RRITESH KAKKAR, May 25, 2013.

  1. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Hi,

    I am learning processing software here is the code for moving object..
    i want to know how to make a file for opening it like flash file/gif images while saving/exporting it it is not doing as i want the processing software window open.


    Code ( (Unknown Language)):
    1.  
    2. float x=200;
    3. float y=100;
    4. float speed=2;
    5.  
    6. void setup(){
    7.   size(200,200);
    8. }
    9. void draw(){
    10.   background(255);
    11.   move();
    12.   display();
    13. }
    14. void move() {
    15.   x=x+speed;
    16.   if (x>width){
    17.     x=0 ;
    18.   }}
    19.   void display(){
    20.     fill(20);
    21.     rect(x,y,30,20);}
     
  2. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Hi,

    I was testing serial communication in processing using PIC16f877 can we use pic with processing? because nothing was happening in screen as per code changing value from UART the color will changes..

    Code ( (Unknown Language)):
    1. import processing.serial.*;
    2.  Serial port; float brightness = 0;
    3.  void setup()
    4. {
    5.  size(1200, 600); //Set size of the window
    6.   port = new Serial(this, "COM6", 9600); //change "COM11" to the usb port, you are using
    7.   port.bufferUntil('\n'); //wait for a value to appear in the Serial monitor
    8.   }
    9.   void draw()
    10.  {     background(0, 0, brightness);
    11.  }
    12. void serialEvent (Serial port)
    13. {
    14.  brightness = float(port.readStringUntil('\n'));
    15.   }
    Code ( (Unknown Language)):
    1. #include <htc.h>
    2.  __CONFIG(LVP_OFF & BOREN_OFF & PWRTE_ON & WDTE_OFF & FOSC_HS);
    3.  #define _XTAL_FREQ 20000000
    4.   void  HSerinit(void), HseroutString(unsigned char* str), Hserout(unsigned char ch);
    5.  void main(void)                        // program entry
    6.  {
    7.      TRISB=0x00;    
    8. unsigned char ch=0 ;         // <- LOOK HERE.
    9.  ADCON1 = 0x6;                    // Analogue off
    10.  HSerinit();
    11.  __delay_ms(150);
    12.  while(1)
    13. {
    14. ch=0; for(char i=0;i<100;i++)
    15. { ch=ch+20;    Hserout(ch); __delay_ms(400); }
    16.  }     }        
    17. void HSerinit()  
    18.   {
    19.  TRISC = 0x80;                    // TX was an input!    
    20. SPBRG = 129;                    // 20Mhz xtal 9600 BAUD
    21.     TXSTA = 0x24;                    // TXEN and BRGH
    22.     RCSTA = 0x90;                    // SPEN and CREN  
    23.   }
    24.  void Hserout(unsigned char ch)  
    25.    {    
    26.  while(!TXIF);    
    27.  TXREG = ch;    
    28.     }      
    29.   }
    showing this error on processing window..

    Display 0 does not exist, using the default display instead.
    WARNING: RXTX Version mismatch
    Jar version = RXTX-2.2pre1
    native lib Version = RXTX-2.2pre2

    I have downloaded the file RXTXcomm.jar in this folder it contain..gnu folder and META-INF i have copied it to Navigate to the Processing folder>modes>java>libraries>serial>library
    but the error remain there why?????
     
  3. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    No.



    ____________________________________________________________________
     
  4. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    ??????????
     
  5. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
  6. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    I have done nothing working please tell what to do?
     
  7. Eric007

    Senior Member

    Aug 5, 2011
    1,041
    33
    Hahahahahahah...LOL :D
     
  8. Eric007

    Senior Member

    Aug 5, 2011
    1,041
    33
    Too Bad Rritesh!

    You now have a bad reputation on the forum that people are nomore willing to help you.
    Also your problem description is poor...you should try to put that nicely so people can pick up quickly what exactly you struggling with instead of making us trying to figure out what your problem is.
    And everybody can tell you never put too much effort yourself...you always rush asking for help.

    Anyway Gudluck!:)
     
    absf, Brian Griffin and DerStrom8 like this.
  9. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Rritesh! I have foreseen that something like this would happen for long time now. You have worn out two forums. The problem with you. Are that you have none what so ever interest in digesting information given to you. A part of being an engineer. Is to be able navigate in unknown water and be able to digest any information that comes your way. Either by reading say datasheets or asking for help in a forum like this. Most often then I help people in this forum. It is enough with a one or two gentle push in the correct direction. And they will figure out the missing part by them self. Unlike you that is not happy until a turn-key ready solution is served on a silver plate. You are more like a nestling constant screaming for food. And it looks like you have no interest in learning, god knows why. You seriously have to work on your attitude regarding this matter. Your English is quite good, so it no language barrier that is the problem. I am quite sure you are capable of reading any manual or datasheet, like most of us on this forum do. So again I think it is your attitude that is the problem. And until you do something with it, people like I. Will put you on their virtual or real ignore list
     
  10. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Believe me, we know!
     
  11. Brian Griffin

    Member

    May 17, 2013
    40
    12
    The thread opener must have been rushing for another contest submission. Especially trying to win it and then claim "it's all mine, you're not". The error in the compilation is extremely obvious (which can be again, found in Google searches), and he should learn to isolate and tackle problems seperately.

    In where I'm living, this same problem is there too. We have been trained to only remember and regurgitate information on many school years. However, I had to grow out of it because I have to, and plus, whatever I'm doing now requires a lot of reading and thinking instead of rote learning.
     
    Last edited: Jun 15, 2013
    DerStrom8 likes this.
  12. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Hi,


    I am suing processing 1.5 with XP 32bit and i want to do serial comm of uC using PIC16F877 with processing and tested that pic uC code in serial terminal window it is transferring 0xff and 0x02 with delay in between to see the color diff on processing window there is no error in both code but then also it is not changing window color why??
    Code ( (Unknown Language)):
    1.  
    2.  
    3. [LIST=1]
    4. [*] #include <htc.h>
    5. [*]  __CONFIG(LVP_OFF & BOREN_OFF & PWRTE_ON & WDTE_OFF & FOSC_HS);
    6. [*]  #define _XTAL_FREQ 20000000
    7. [*]   void  HSerinit(void), HseroutString(unsigned char* str), Hserout(unsigned char ch);
    8. [*]  void main(void)                        // program entry
    9. [*]  {
    10. [*]      TRISB=0x00;
    11. [*]        // <- LOOK HERE.
    12. [*]  ADCON1 = 0x6;                    // Analogue off
    13. [*]  HSerinit();
    14. [*]  __delay_ms(150);
    15. [*] unsigned char ch=0;
    16. [*]  while(1)
    17. [*] {
    18. [*] ch=0xff ;
    19. [*]    Hserout(ch);
    20. [*] __delay_ms(500);
    21. [*]  ch=0x02 ;
    22. [*]    Hserout(ch);
    23. [*] __delay_ms(500);
    24. [*] }
    25. [*]  }
    26. [*] void HSerinit()
    27. [*]   {
    28. [*]  TRISC = 0x80;                    // TX was an input!
    29. [*] SPBRG = 129;                    // 20Mhz xtal 9600 BAUD
    30. [*]     TXSTA = 0x24;                    // TXEN and BRGH
    31. [*]     RCSTA = 0x90;                    // SPEN and CREN
    32. [*]   }
    33. [*]  void Hserout(unsigned char ch)
    34. [*]    {
    35. [*]  while(!TXIF);
    36. [*]  TXREG = ch;
    37. [*]     }
    38. [/LIST]
    39.  

    Code ( (Unknown Language)):
    1. import processing.serial.*;
    2.   Serial port; float brightness = 00;
    3.   void setup()
    4.  {
    5.   size(1200, 600); //Set size of the window
    6.    port = new Serial(this, "COM11", 9600); //change "COM11" to the usb port, you are using
    7.    port.bufferUntil('\n'); //wait for a value to appear in the Serial monitor
    8.    }
    9.    void draw()
    10.   {     background(0, 0, brightness);
    11.   }
    12.  void serialEvent (Serial port)
    13.  {
    14.   brightness = float(port.readStringUntil('\n'));
    15.    }
    16.  
     
  13. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    :eek:

    That seems a bit harsh, don't you think. Sure, you may be having problems getting something to work, but to take them to court over it? :p
     
  14. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Before this i was using window 7 with 64 bit then it was showing error now what to do?
     
  15. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    Give up? Yeah. Give up.
     
    DerStrom8 and tshuck like this.
  16. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    what give up?
    now its not showing error too and not working.
     
  17. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    What are you using now? What happened the the Win7 x64 machine? Where in the world is Carmen Sandiego?
     
  18. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,646
    759
    Preparing herself for a comeback. J Lo will be the producer, it seems...
     
  19. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    I have changed 7 to XP for testing...
     
  20. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    Testing what?
     
Loading...