This file contains 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
// This is the clear code for CH376S UART communication. | |
#include <SoftwareSerial.h> | |
byte USB_Byte; //used to store data coming from the USB stick | |
int LED = 13; //the LED is connected to digital pin 13 | |
int timeOut = 2000; //TimeOut is 2 seconds. This is the amount of time you wish to wait for a response from the CH376S module. | |
SoftwareSerial USB(10, 11); // Digital pin 10 on Arduino (RX) connects to TXD on the CH376S module | |
// Digital pin 11 on Arduino (TX) connects to RXD on the CH376S module |
This file contains 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
#include "DHT.h" | |
#define DHTPIN 3 | |
#define DHTTYPE DHT11 | |
DHT dht(DHTPIN, DHTTYPE); | |
void setup() { | |
Serial.begin(9600); | |
Serial.println("Initializing..."); | |
pinMode(2, OUTPUT); |
This file contains 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
#include <SoftwareSerial.h> | |
int val = 0; | |
int redLEDPin = 9; | |
int greenLEDPin = 10; | |
int blueLEDPin = 11; | |
void setup() { | |
pinMode(redLEDPin, OUTPUT); | |
pinMode(greenLEDPin, OUTPUT); |
This file contains 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
//===================================Under Ground Carge System=================================== | |
/* | |
The system is based on Arduino UNO and modules including step motor, DC motors, etc. | |
Connect 4 switch for mode switch on pin 0, 1, 2, 3; 1 step motor for platform on pin 4, 5, 6, 7; | |
Connect 3 servo motors for gate on pin 9, 10, 11; 3 output for DC motors on pin A0, A1, A2. | |
Function "setMotor" setup the gates status. | |
Function "setOutput" setup the DC motors status. | |
*/ | |
//================================================================================================ |
This file contains 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
#include <SoftwareSerial.h> | |
SoftwareSerial BT(11, 12); // RX & TX | |
char val; | |
boolean state2 = 0; | |
void setup() | |
{ | |
pinMode(13, OUTPUT); | |
digitalWrite(13, 1); |
This file contains 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
#include <SoftwareSerial.h> | |
SoftwareSerial BT(11, 12); | |
int state = 0; | |
void setup(){ | |
Serial.begin(9600); | |
BT.begin(9600); | |
pinMode(A1, INPUT); | |
pinMode(A2, INPUT); | |
pinMode(A3, INPUT); |