Created
March 16, 2012 16:33
-
-
Save arduinoboard/2050936 to your computer and use it in GitHub Desktop.
The file that is currently on an Arduino Duemilanove or Nano w/ ATmega328 with a serial number of FTE4XX77
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Project: Use Arduino to control a TX2/RX2-based radio control transmitter/receiver | |
Developer: Hazim Bitar/TechBitar | |
Date: Nov 18, 2011 | |
Web: http://techbitar.blogspot.com | |
*/ | |
int TX2Pin01 = 8; // Right | |
int TX2Pin14 = 9; // Left | |
int TX2Pin05 = 10; // Forward | |
int TX2Pin04 = 11; // Backward | |
void setup() { | |
// Initialize 4 digital pins for output to communicate with the TX2 function pins | |
pinMode(TX2Pin01, OUTPUT); | |
pinMode(TX2Pin14, OUTPUT); | |
pinMode(TX2Pin05, OUTPUT); | |
pinMode(TX2Pin04, OUTPUT); | |
// Turn off all TX2 function pins, by setting them to high. | |
digitalWrite(TX2Pin01, HIGH); // set the TX2 pin 1 on (Right) | |
digitalWrite(TX2Pin14, HIGH); // set the TX pin 14 on (Left) | |
digitalWrite(TX2Pin05, HIGH); // set the TX2 pin 1 on (Right) | |
digitalWrite(TX2Pin04, HIGH); // set the TX pin 14 on (Left) | |
Serial.begin(9600); | |
} | |
void loop() { | |
// Turn on Right function pin which is TX2 Pin 1 | |
Serial.println("TX2Pin01, LOW/GND/GO RIGHT"); | |
digitalWrite(TX2Pin01, LOW); // Turn ON TX2 pin 1 (Right) | |
delay(2000); // wait for a while | |
// Turn off Right function pin which is TX2 Pin 1 | |
Serial.println("TX2Pin01, HIGH/STOP"); | |
digitalWrite(TX2Pin01, HIGH); // Turn OFF TX2 pin 1 (Right) | |
delay(2000); // wait for a while | |
// Turn on Left function pin which is TX2 Pin 14 | |
Serial.println("TX2Pin14, LOW/GND/GO LEFT"); | |
digitalWrite(TX2Pin14, LOW); // Turn ON TX2 pin 14 (Left) | |
delay(2000); // wait for a while | |
// Turn off Left function pin which is TX2 Pin 14 | |
Serial.println("TX2Pin14, HIGH/STOP"); | |
digitalWrite(TX2Pin14, HIGH); // Turn OFF TX2 pin 14 (Left) | |
delay(2000); // wait for a while | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment