Pages: [1]   Go Down
Author Topic: Control Serial Devices  (Read 416 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


Logged

France
Offline Offline
Faraday Member
**
Karma: 23
Posts: 3031
There is an Arduino for that
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is a starting point:

if button 1 = high
 Serial.print("ASCII")

ect

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

Here is an example:

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

loop
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.
Logged

UK
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2883
Gorm deficient
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
if button 1 = high

Oh dear!  :o
Logged

Per Arduino ad Astra

SG
Offline Offline
Sr. Member
****
Karma: 7
Posts: 425
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
 if (button1State == HIGH)    
      Serial.println("lamp on");
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Cumming, GA
Offline Offline
Edison Member
*
Karma: 18
Posts: 1628
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Pages: [1]   Go Up
Jump to: