Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int verbose = 1;
- int debug = 0;
- /* Define the uart we are reading from (In this case Serial1)*/
- Stream* uart1;
- //Start up the Bitdex operations
- void setup(){
- //Open Arduino Serials port for USB
- Serial.begin(9600);
- //Open the Serial1 TX/RX lines
- Serial1.begin(9600);
- //Print string
- printString("Booting up....", 1, 0);
- //Start up WiFly -- Boot wifi componenet
- printString("Initalizing WiFi", 0, 1);
- printString("Wifi Handshake | Success", 1, 0);
- delay(1000);
- printString("Entering command mode", 0, 1);
- Serial1.println("$$$");
- }
- void loop(){
- if(Serial1.available()){
- Serial.println(Serial1.read());
- }
- }
- /* WiFly Functions */
- void setUart(Stream* uart){
- }
- /* Help full functions */
- void printString(String string_to_print, int verbose_required, int debug_required){
- int printHappened = 0;
- //Is verbose or debug required to print this string?
- if((verbose_required == 1 && verbose == 1) || debug_required == 1 && debug == 1){
- //Print string
- Serial.print(string_to_print);
- printHappened = 1;
- }
- if(verbose_required == 0 && debug_required == 0 && printHappened == 0){
- //Print string
- Serial.print(string_to_print);
- printHappened = 1;
- }
- if(printHappened){
- //Make a new line to keep the terminal tidy
- Serial.print("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement