Send RS232 commands with P5 to a video projector
in
Integration and Hardware
•
9 months ago
Hello everybody,
I currently in developing a stand alone system of video projection, the system must starting up and shutdown alone everyday during one month, that is why I would like to send RS232 commands to the video projector, for start and shutdown it, via P5.
In this document, we can view all the RS232 commands for my video projector, but when I try to send it with P5, via a usb/serial adapter, nothing happend...
This is my P5 code:
- import processing.serial.*;
- Serial RS232;
- void setup()
- {
- size(255,255);
- RS232 = new Serial(this, "/dev/tty.usbserial", 115200);
- RS232.bufferUntil(10);
- }
- void draw()
- {
- }
- void keyPressed()
- {
- if (key == '1')
- {
- sendPowerOn();
- println("Send power on message");
- }
- else if (key == '2')
- {
- sendPowerOff();
- println("Send power off message");
- }
- }
- void sendPowerOn()
- {
- RS232.write("<CR>*pow=on#<CR>");
- }
- void sendPowerOff()
- {
- RS232.write("<CR>*pow=off#<CR>");
- }
Any help would be useful, thank in advance.
Jérémy
1