We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpElectronics,  Serial Library › Sending data from processing to arduino
Page Index Toggle Pages: 1
Sending data from processing to arduino (Read 1147 times)
Sending data from processing to arduino
Apr 10th, 2009, 8:19am
 
I wanna send data received as user input in Processing to the arduino to use that data. In my processing code below, i need to send the variables "h" and "m" to the arduino. The arduino in turn should use those data to do something else but i guess my question is: how does arduino reference H and m from processing? Pls help. Thanks!

//Processing code
import javax.swing.JOptionPane;

String user_hour  = (String)JOptionPane.showInputDialog(null, "Hour :","Datainputdialog", JOptionPane.PLAIN_MESSAGE);
         String user_min  = (String)JOptionPane.showInputDialog(null, "Minute:","Datainputdialog", JOptionPane.PLAIN_MESSAGE);
         int h = Integer.parseInt(user_hour);
         int m = Integer.parseInt(user_min);

//Arduino code
time_t  alarmOnTime =  (h* SECS_PER_HOUR) + (m * SECS_PER_MIN);
Page Index Toggle Pages: 1