当前位置: 首页>>代码示例>>C++>>正文


C++ SoftwareSerial::begin方法代码示例

本文整理汇总了C++中SoftwareSerial::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ SoftwareSerial::begin方法的具体用法?C++ SoftwareSerial::begin怎么用?C++ SoftwareSerial::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SoftwareSerial的用法示例。


在下文中一共展示了SoftwareSerial::begin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setup

void setup()
{
    RFID.begin(9600); // start serial to RFID reader
    Serial.begin(9600); // start serial to PC
    //lcd.print("hello, world!");
    Serial.println("Ready!");
}
开发者ID:Bensky13,项目名称:arduinyeah,代码行数:7,代码来源:BenFull.cpp

示例2: setup

void setup()
{
  /* button click interrupt */
  attachInterrupt(1, buttonClicked, FALLING);
  /* start hw & sw serial */
  Serial.begin(WILLIAM_BAUDRATE); // output
  mySerial.begin(MIDI_BAUDRATE); // input
  /* set up song and songbank callbacks */
  setupSongHandling();
  /* set initial outgoing packet (to William) */
  setOutgoingPacket(WHITE);
  /* setup status leds for debugging */
  DDRB |= (1<<0)|(1<<2)|(1<<3)|(1<<4)|(1<<5);
  DDRD |= (1<<5)|(1<<6);
  /* start 38KHz carrier wave for infrared TX */
  init_ir_modulator();
#ifdef _DEBUG
  for (int i=0; i < COLOUR_TRIPLET_N; i++){
    char * p_triplet = colourTriplets[i];
    for (int j=0; j < 3; j++)
      Serial.write(p_triplet[j]);
    Serial.write(9);
  }
  Serial.write(songBank.n);
  for (unsigned int i=0; i < songBank.n; i++) {
    Serial.write(songBank.pp_songs[i]->n);
    for (int j=0; j < songBank.pp_songs[i]->n; j ++) {
      Serial.write(songBank.pp_songs[i]->p_events[j].note);
    }
  }
#endif
}
开发者ID:entrity,项目名称:treasure-hunt-des-marais,代码行数:32,代码来源:main.cpp

示例3: join

 void S4::begin(char* DeviceName, char* RouterName)
 {
      deviceName = DeviceName;
      WDTCSR |= (1 << WDCE) | (1 << WDE);
      WDTCSR = 0;
      microSerial.begin(buadRate);  // this had to be before the gps
      Wire.begin(); 
      
      
      S4GPS.begin(buadRate);
      
      if(WiFiIsOn)
      {
          WiFly.begin();                // start the WiFly process
          join(RouterName); // connect to the router
          WiFiHankshake(DeviceName);    // connect to the server
      }
     
     
      
      
      sensorData = "<sensor>";
      sensorData += deviceName;
      sensorData += ",";
      Serial.println("Starting");
 }
开发者ID:notkevinjohn,项目名称:S4Payload,代码行数:26,代码来源:S4.cpp

示例4: setup

void setup()
{
    RFID.begin(9600); // start serial to RFID reader
    Serial.begin(9600); // start serial to PC
    lcd.begin(16, 2);
    //lcd output
        lcd.clear();
        lcd.print("There are "); //start printing the result
        lcd.print(space_left); //then how many spaces
        lcd.print("  spaces left."); //words
        lcd.println(" "); //spaces
    
    for (int i = 0; i < 5; i++)
    {
       id_marker[i] = 0;
    }
    
    Serial.println("Ready!");
     
  //sets everything in the array equal to blank
 for(int i=0; i<5; i++)
        {
            id_array[i] = String("");
        }
  
}
开发者ID:Bensky13,项目名称:arduinyeah,代码行数:26,代码来源:Ben_Working0408.cpp

示例5: main

int main(int argc, char** argv){
#if defined(ARDUINO) && (defined(DEBUG_NW) || defined(DEBUG_MQTTSN) || defined(DEBUG))
	debug.begin(9600);
#endif
	setup();
    loop();
}
开发者ID:kaz260,项目名称:ESP8266-MQTT-SN-Temp,代码行数:7,代码来源:MqttsnClient.cpp

示例6: setup

void setup()
{
	response.reserve(RESPONSE_BUFFER);
	url.reserve(STRING_BUFFER);
	cmd.reserve(COMMAND_BUFFER);

	Serial.begin(9600);
	Serial.println("PowerInterlock Start");
	turnOff();
	disableTiming();

	RFID.begin(2400);
	delay(500);

	pinMode(RFID_ENABLE, OUTPUT);
	//digitalWrite(RFID_ENABLE, LOW);
	pinMode(DEVICE_PIN, OUTPUT);

	Ethernet.begin(mac, ip, dns1);
	//After a couple hours, the DHCP started to fail for some reason
	/*if (Ethernet.begin(mac) == 0) {
		Serial.println("Failed to configure Ethernet using DHCP");
		Ethernet.begin(mac, ip);
	}*/
	// give the Ethernet shield a second to initialize:
	delay(1000);
}
开发者ID:mikelduke,项目名称:DMS-RFID-Interlock,代码行数:27,代码来源:PowerInterlock.cpp

示例7: begin

void ICACHE_FLASH_ATTR GlobalsClass::begin()
{
	//serveron("/probesave", handleProbeSave);	
	//MyWebServer.ServerON("/test", &TestCallback);
    //MyWebServer.CurServer->on("/test", TestCallback);
	server.on("/flashavr", FlashHM);
	server.on("/hm/curinfo", sendHMJsonweb);
	server.on("/hm/set", setHMweb);
	server.on("/testgz", testgz);
	
	MyWebServer.jsonSaveHandle = &JsonSaveCallback;  //server on jsonsave file we hook into it to see which one and process....

#ifdef SoftSerial
#include <SoftwareSerial.h>
	qCon.begin(HM_COM_BAUDRATE);
	delay(20);
//	qCon.enableRx(true);
	delay(20);
#endif

#ifdef HardSerial
		#ifdef HardSerialSwap
			Serial.swap();  //toggle between use of GPIO13/GPIO15 or GPIO3/GPIO(1/2) as RX and TX
		#endif
#endif

	if (WiFi.status() == WL_CONNECTED)
	{
		// ... print IP Address to HM
		qCon.println("/set?tt=WiFi Connected,"+ (String)WiFi.localIP()[0] + "." + (String)WiFi.localIP()[1] + "." + (String)WiFi.localIP()[2] + "." + (String)WiFi.localIP()[3]);
	} else qCon.println("/set?tt=WiFi NOT, Connected!!"); 
	
}
开发者ID:nailbuster,项目名称:EspressModuleHM,代码行数:33,代码来源:globals.cpp

示例8: setup

//*******************************************************
//               SETUP
//*******************************************************
void setup(){
  Serial.begin(9600);
  Serial.println("Starting Slave...");
  delay(2000);
  //Fast-SPI initialisieren
  FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);

  //Zuerst PWM-Treiber disable
  Serial.println("Set PWM off");
  pinMode(Enable,OUTPUT);
  digitalWrite(Enable,LOW);
  DisplayRGB(0,0,0);//LED-Streifen auf Schwarz
  delay(1000);

  Serial.println("Set SPI off");
  //Alle Fast-SPI-Lampen aus
  for (int a=0;a<NUM_LEDS;a++){
    leds[a]=CRGB::Black;
  }
  Serial.println("Init RS485");
  //RS485 Initialisieren
  rs485.begin (9600);
  pinMode (ENABLE_PIN, OUTPUT);  // driver output enable
  Serial.println("Start loop...");
}
开发者ID:wolfi-by,项目名称:Beleuchtung,代码行数:28,代码来源:WelcomeSaeule_Nano.cpp

示例9: UploadResults

void UploadResults() {
    leds[0] = CRGB::Yellow;
    FastLED.show();

    uint16_t returncode;
    TurnOnFona();
    delay(1000);
    myfona.begin(4800);
    fona.begin(myfona);
    delay(3500);
    GetConnected();
    delay(3000);
    fona.enableGPRS(true);
    delay(3000);

    char url[200];
    uint16_t statuscode;
    int16_t length;
    sprintf(url, "%s%s%s%s", "http://api.ubirch.com/rp15/push?id=", userid, "&erg=", results);
    flushSerial();
    if (!fona.HTTP_GET_start(url, &statuscode, (uint16_t *) &length)) {
        Serial.println(F("Get Failed!"));
    }
    fona.HTTP_GET_end();


    delay(100);
    GetDisconnected();
    delay(1000);
    TurnOffFona();
    leds[0] = CRGB::Black;
    FastLED.show();
}
开发者ID:ubirch,项目名称:ubirch-avr,代码行数:33,代码来源:pushbutton.cpp

示例10: setup

void setup()
{
  gprsSerial.begin(9600);
  Serial.begin(9600);

  Serial.println("Config SIM900...");
  delay(2000);
  Serial.println("Done!...");
  gprsSerial.flush();
  Serial.flush();

  // attach or detach from GPRS service 
  gprsSerial.println("AT+CGATT?");
  delay(100);
  toSerial();


  // bearer settings
  gprsSerial.println("AT+SAPBR=3,1,\"CONTYPE\",\"GPRS\"");
  delay(2000);
  toSerial();

  // bearer settings
  gprsSerial.println("AT+SAPBR=3,1,\"APN\",\"airtelgprs.com\"");
  delay(2000);
  toSerial();

  // bearer settings
  gprsSerial.println("AT+SAPBR=1,1");
  delay(2000);
  toSerial();
}
开发者ID:spojsolutions,项目名称:spoj,代码行数:32,代码来源:arduino_shuttle.cpp

示例11: setup

void setup() {

  // Init display
  mySerial.begin(9600); // set up serial port for 9600 baud
  delay(500); // wait for display to boot up
  


  // Setup DS1820 temp sensor

  sensors.begin();
  sensors.setResolution(Sensor1, 11);
  sensors.setResolution(Sensor2, 11);
  sensors.setWaitForConversion(false);
  sensors.requestTemperatures();
  delayInMillis = 750 / (1 << (12 - 11)); //750 for 12bit, 400 for 11bit, 220 for 10bit, 100 for 9bit
                        // calc by   delayInMillis = 750 / (1 << (12 - resolution)); 
  lastTempRequest = millis(); 


  // Set next state i FSM
  menu_FSM = M_PAGE1;
  menu_last_state = M_PAGE1;
  system_FSM = S_IDLE;
 
 
   // **************** Set up display *******************
  DisplayClear();
  MenuShowTime = millis();
 
  
  // **************** Set up RTC ***********************
  Wire.begin();
  rtc.begin();
  //TimeDate(rtc.now(),dateTimeString,1);

  //DateTime now = rtc.now();

 // write on display
  DisplayGoto(2,0);
  mySerial.print("Version 0.9B");

  
  // **************** Set up SD card *******************
  pinMode(10, OUTPUT);
  DisplayGoto(1,0);
  mySerial.write("Init SD -> "); // clear display + legends
 
  DisplayGoto(1,11);
  // see if the card is present and can be initialized:
  if (!SD.begin())
    mySerial.write("Fail");
  else
    mySerial.write("OK");
  delay(2000);
  
  // ***************** Clear display ********************
  DisplayClear();
   
  }
开发者ID:lvesterg,项目名称:heater,代码行数:60,代码来源:heater_FSM.c

示例12: begin

// Herkulex begin with Arduino Uno
void HerkulexClass::begin(long baud, int rx, int tx)
{
	SwSerial.setRX(rx);
	SwSerial.setTX(tx);
	SwSerial.begin(baud);
	port = SSerial;
}
开发者ID:MechanicalCoder,项目名称:Prosthetic-Hands,代码行数:8,代码来源:Herkulex.cpp

示例13: setup

// **************************************************************************
// *                            Power Up Initial
// **************************************************************************
void setup() 
{ 
  mySerial.begin(4800);
  Serial.begin(10420);
  delay(500);
  line_following.line_following_setup();   //initialize the status of line following robot
  line_following.all_stop();               //all motors stop
}
开发者ID:petosegan,项目名称:home_robot,代码行数:11,代码来源:motor_control.cpp

示例14: SoftwareSerial

PZEM004T::PZEM004T(uint8_t receivePin, uint8_t transmitPin)
{
    SoftwareSerial *port = new SoftwareSerial(receivePin, transmitPin);
    port->begin(PZEM_BAUD_RATE);
    this->serial = port;
    this->_readTimeOut = PZEM_DEFAULT_READ_TIMEOUT;
    this->_isSoft = true;
}
开发者ID:olehs,项目名称:PZEM004T,代码行数:8,代码来源:PZEM004T.cpp

示例15: setup

/* Arduino-required function */
void setup()
{
  Serial.begin(9600);
  mySerial.begin(MIDI_BAUDRATE);
  /* Set callbacks for songs */
  data_short.setCallbacks( complete_data_short, NULL );
  epona.setCallbacks( complete_epona, NULL );
  fifties_short.setCallbacks( complete_fifties_short, NULL );
}
开发者ID:entrity,项目名称:Arduino-MIDI-reader,代码行数:10,代码来源:listen-for-songbank.cpp


注:本文中的SoftwareSerial::begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。