Go Down

Topic: Control Serial Devices (Read 1 time) previous topic - next topic


Does anyone have any suggestions on interfacing with a projector?  

I would like to send a serial commands to a projector via the press of button on the arduino.  

I have sent strings to the device using a max232.  I would like to program multiple buttons to perform specfic tasks such as turn projector on or off and switch between sources.  

I have not been able to find any sketches that would allow a button to trigger a stored ascii string.


You have the idea.
Code it.
We will help you to troubleshot your code if any problem.


Here is a starting point:

if button 1 = high


start by writting in plain language and then people can help.

Here is an example:

button 1 = lamp on
button 2 = lamp off
button 3 = input 1
button 4 = input 2
button 5 = shutter close

if button 1 = pressed
send "lamp on"
if button 2 = pressed
Send "lamp off"
if button 3 = pressed
send "input 1"
if button 4 = pressed
Send "input 2"
if button 5 = pressed
send "shutter"

I would suggest looking at the "button" example file to understand how to setup the inputs. From there replace the button action with your serial commands.


if button 1 = high

Oh dear!  :o
Some people are like Slinkies.

Not really good for anything, but they bring a smile to your face when pushed down the stairs.


Code: [Select]
 if (button1State == HIGH)    
     Serial.println("lamp on");


Thanks this is information is very helpful.  I will work on this tonight and post the code.


Oh dear!  Shocked

To be fair... he did indicate he was writing pseudo code first... which is a good idea for anyone new to this stuff.

The thing you need to decide is if you want to be able to DEBUG with USB and send to device at the same time.  If so, you might need to look into the SOFTSERIAL library as part of the solution.

Go Up