Skip to content

Instantly share code, notes, and snippets.

@K-ways
K-ways / CH376S_UART_One.ino
Created November 17, 2016 07:14
CH376S USB Chip with UART Communication.
// 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
@K-ways
K-ways / DHT.ino
Last active September 2, 2015 06:37
Arduino Code for 2nd EE Summer Camp © 2015 by K-ways.
#include "DHT.h"
#define DHTPIN 3
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
Serial.println("Initializing...");
pinMode(2, OUTPUT);
@K-ways
K-ways / colerChange.ino
Last active August 29, 2015 14:24
Code for student using Arduino YUN with HC-05 bluetooth module, full-color LED, and DHT module. Copyright © 2015 by K-ways & Joseph.
#include <SoftwareSerial.h>
int val = 0;
int redLEDPin = 9;
int greenLEDPin = 10;
int blueLEDPin = 11;
void setup() {
pinMode(redLEDPin, OUTPUT);
pinMode(greenLEDPin, OUTPUT);
@K-ways
K-ways / undergoSystem.ino
Created June 8, 2015 16:54
Future City Workshop Project "UNDERGO". Copyright © 2015 by team "UnderGo".
//===================================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.
*/
//================================================================================================
@K-ways
K-ways / bluetoothMaster.ino
Last active August 29, 2015 14:19
Code for Arduino and Bluetooth module. Copyright © 2014 by K-ways.
#include <SoftwareSerial.h>
SoftwareSerial BT(11, 12); // RX & TX
char val;
boolean state2 = 0;
void setup()
{
pinMode(13, OUTPUT);
digitalWrite(13, 1);
@K-ways
K-ways / BananaSensor.ino
Last active August 29, 2015 14:14
Maker Winter Club
#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);