Examples of Serial


Examples of com.joshondesign.arduino.common.Serial

    private void connect(SerialPort port) {
        try {
            connected = true;
            serialActive.setText("Connected");
            serialRateCombo.setEnabled(false);
            serial = new Serial(port.portName, 9600, 'N', 8, 1.0f);
            serial.addListener(new MessageConsumer() {
                @Override
                public void message(String s) {
                    serialConsole.append(s);
                    if(actions.sketch.isAutoScroll()) {
View Full Code Here

Examples of com.neophob.sematrix.core.output.Serial

    if (portName == null) {
      return;
    }
   
    try {
      port = new Serial(portName, this.baud);
      sleep(1500); //give it time to initialize
      if (ping()) {

        //send initial image to rainbowduinos
        for (int i: rainbowduinoAddr) {
View Full Code Here

Examples of com.neophob.sematrix.core.output.Serial

    if (portName == null) {
      return;
    }
   
    try {
      port = new Serial(portName, this.baud);
      sleep(1500); //give it time to initialize
      if (ping()) {
        return;
      }
     
View Full Code Here

Examples of com.neophob.sematrix.core.output.Serial

    if (portName == null) {
      return;
    }
   
    try {
      port = new Serial(portName, this.baud);
      sleep(1500); //give it time to initialize
      if (ping()) {
        return;
      }
      LOG.log(Level.WARNING, "No response from port {0}", portName);
View Full Code Here

Examples of com.neophob.sematrix.core.output.Serial

        LOG.log(Level.INFO, "portName == null");
      return;
    }
   
    try {
      port = new Serial(portName, this.baud);
      sleep(1500); //give it time to initialize
      if (ping()) {
        return;
      }
      LOG.log(Level.WARNING, "No response from port {0}", portName);
View Full Code Here

Examples of com.neophob.sematrix.core.output.Serial

   * @param portName the port name
   * @throws NoSerialPortFoundException the no serial port found exception
   */
  private void openPort(String portName) throws NoSerialPortFoundException {
    try {
      port = new Serial(portName, this.baud);     
      port.output.write("PXL".getBytes());
    } catch (Exception e) { 
      LOG.log(Level.WARNING, "Failed to open port <"+portName+">", e);
      if (port != null) {
        port.stop();                 
View Full Code Here

Examples of com.pi4j.io.serial.Serial

       
       
       

        // create an instance of the serial communications class
        final Serial serial = SerialFactory.createInstance();

        // create and register the serial data listener
        serial.addListener(new SerialDataListener() {
            @Override
            public void dataReceived(SerialDataEvent event) {
                // print out the data received to the console
                String v = event.getData();
                //System.out.print(v);
               
               
               
                hs.store(v,fm.getSeial());
                System.out.print(ANSI_WHITE + v + " m/s" +ANSI_GREEN);
               
               

            }
        });

        run_pin.high();
       
        try {
            // open the default serial port provided on the GPIO header
            serial.open(Serial.DEFAULT_COM_PORT, 38400);

            // continuous loop to keep the program running until the user terminates the program
            for (;;) {
         
               
View Full Code Here

Examples of it.baeyens.arduino.arduino.Serial

     * @param bautrate
     *            The baud rate to set
     * @return true is successful otherwise false
     */
    public static boolean reset_Arduino_by_baud_rate(String ComPort, int baudrate, long openTime) {
  Serial serialPort;
  try {
      serialPort = new Serial(ComPort, baudrate);
  } catch (Exception e) {
      e.printStackTrace();
      Common.log(new Status(IStatus.WARNING, ArduinoConst.CORE_PLUGIN_ID, "Unable to open Serial port " + ComPort, e));
      return false;
  }

  try {
      Thread.sleep(openTime);
  } catch (InterruptedException e) {// Jaba is not going to write this
            // code
  }
  serialPort.dispose();
  return true;
    }
View Full Code Here

Examples of it.baeyens.arduino.arduino.Serial

    return wait_for_com_Port_to_appear(OriginalPorts, ComPort);
      }
  }

  // connect to the serial port
  Serial serialPort;
  try {
      serialPort = new Serial(ComPort, 9600);
  } catch (Exception e) {
      e.printStackTrace();
      Common.log(new Status(IStatus.WARNING, ArduinoConst.CORE_PLUGIN_ID, "Unable to open Serial port " + ComPort, e));
      return ComPort;
      // throw new RunnerException(e.getMessage());
  }
  if (!serialPort.IsConnected()) {
      Common.log(new Status(IStatus.WARNING, ArduinoConst.CORE_PLUGIN_ID, "Unable to open Serial port " + ComPort, null));
      return ComPort;
  }

  if (!bDisableFlushing) {
      // Cleanup the serial buffer
      flushSerialBuffer(serialPort);// I wonder is this code on the right
            // place (I mean before the reset?;
            // shouldn't it be after?)
  }
  // reset arduino
  ToggleDTR(serialPort, 100);

  serialPort.dispose();
  return ComPort;

    }
View Full Code Here

Examples of it.baeyens.arduino.arduino.Serial

    @Override
    public void dispose() {
  // As we have a listener we need to remove the listener
  if ((myScopelistener != null) && (mySerial != null)) {
      Serial tempSerial = mySerial;
      mySerial = null;
      tempSerial.removeListener(myScopelistener);
      myScopelistener.dispose();
      myScopelistener = null;
      myScope.dispose();
      myScope = null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.