Help in processing...

Thread Starter

RRITESH KAKKAR

Joined Jun 29, 2010
2,829
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.


Rich (BB code):
float x=200;
float y=100;
float speed=2;

void setup(){
  size(200,200);
}
void draw(){
  background(255);
  move();
  display();
}
void move() {
  x=x+speed;
  if (x>width){
    x=0 ;
  }}
  void display(){
    fill(20);
    rect(x,y,30,20);}
 

Thread Starter

RRITESH KAKKAR

Joined Jun 29, 2010
2,829
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..

Rich (BB code):
import processing.serial.*;
 Serial port; float brightness = 0;
 void setup() 
{
 size(1200, 600); //Set size of the window 
  port = new Serial(this, "COM6", 9600); //change "COM11" to the usb port, you are using 
  port.bufferUntil('\n'); //wait for a value to appear in the Serial monitor 
  } 
  void draw()
 {     background(0, 0, brightness);
 } 
void serialEvent (Serial port) 
{
 brightness = float(port.readStringUntil('\n')); 
  }
Rich (BB code):
#include <htc.h>
 __CONFIG(LVP_OFF & BOREN_OFF & PWRTE_ON & WDTE_OFF & FOSC_HS);
 #define _XTAL_FREQ 20000000 
  void  HSerinit(void), HseroutString(unsigned char* str), Hserout(unsigned char ch);
 void main(void)                        // program entry
 { 
     TRISB=0x00;    
unsigned char ch=0 ;         // <- LOOK HERE.
 ADCON1 = 0x6;                    // Analogue off
 HSerinit();
 __delay_ms(150);
 while(1)
{
ch=0; for(char i=0;i<100;i++)
{ ch=ch+20;    Hserout(ch); __delay_ms(400); }
 }     }         
void HSerinit()   
  {
 TRISC = 0x80;                    // TX was an input!     
SPBRG = 129;                    // 20Mhz xtal 9600 BAUD 
    TXSTA = 0x24;                    // TXEN and BRGH 
    RCSTA = 0x90;                    // SPEN and CREN   
  }
 void Hserout(unsigned char ch)  
   {    
 while(!TXIF);    
 TXREG = ch;     
    }       
  }
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?????
 

Eric007

Joined Aug 5, 2011
1,158
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!:)
 

t06afre

Joined May 11, 2009
5,934
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
 

Brian Griffin

Joined May 17, 2013
64
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:

Thread Starter

RRITESH KAKKAR

Joined Jun 29, 2010
2,829
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??
Rich (BB code):
  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. // <- LOOK HERE.
  9. ADCON1 = 0x6; // Analogue off
  10. HSerinit();
  11. __delay_ms(150);
  12. unsigned char ch=0;
  13. while(1)
  14. {
  15. ch=0xff ;
  16. Hserout(ch);
  17. __delay_ms(500);
  18. ch=0x02 ;
  19. Hserout(ch);
  20. __delay_ms(500);
  21. }
  22. }
  23. void HSerinit()
  24. {
  25. TRISC = 0x80; // TX was an input!
  26. SPBRG = 129; // 20Mhz xtal 9600 BAUD
  27. TXSTA = 0x24; // TXEN and BRGH
  28. RCSTA = 0x90; // SPEN and CREN
  29. }
  30. void Hserout(unsigned char ch)
  31. {
  32. while(!TXIF);
  33. TXREG = ch;
  34. }

Rich (BB code):
import processing.serial.*;
  Serial port; float brightness = 00;
  void setup() 
 {
  size(1200, 600); //Set size of the window 
   port = new Serial(this, "COM11", 9600); //change "COM11" to the usb port, you are using 
   port.bufferUntil('\n'); //wait for a value to appear in the Serial monitor 
   } 
   void draw()
  {     background(0, 0, brightness);
  } 
 void serialEvent (Serial port) 
 {
  brightness = float(port.readStringUntil('\n')); 
   }
 
Top