Using Macros with RCKit

39 views
Skip to first unread message

Xavier Lavallée

unread,
Apr 19, 2012, 12:51:51 PM4/19/12
to rc...@googlegroups.com
Hello,

I was working on a tank that could be controlled using RCKit and I can't figure out how to link macros, say I click on a button and it runs a program.

The program would look like:

const int buttonPin = 2;
const int ledPin =  X;

// variables will change:
int buttonState = 0;         

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(buttonPin, INPUT);     
}

void loop(){

  buttonState = digitalRead(buttonPin);

  if (buttonState == HIGH) {     
    digitalWrite(ledPin, HIGH);  
    delay(24);
    digitalWrite(ledPin, LOW);

  } 
  else {
    digitalWrite(ledPin, LOW); 
  }
}

The button would be the digital output coming from the remote program.

Thanks!

Mike McCauley

unread,
Apr 19, 2012, 7:26:02 PM4/19/12
to rc...@googlegroups.com
Hello,

See the example of the Horn in the DifferentialRCRx.pde in the RCKit
distribution.

Cheers.

--
Mike McCauley mi...@open.com.au
Open System Consultants Pty. Ltd
9 Bulbul Place Currumbin Waters QLD 4223 Australia http://www.open.com.au
Phone +61 7 5598-7474 Fax +61 7 5598-7070

Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, NetWare etc.

Reply all
Reply to author
Forward
0 new messages