Showing posts with label serial. Show all posts
Showing posts with label serial. Show all posts
Monday, August 22, 2016
Example of using jSSC communicate between JavaFX and Arduino Uno via USB Serial port
Example of using jSSC communicate between JavaFX and Arduino Uno via USB Serial port
Prepare a simple sketch run on Arduino Uno to send a counting number to serial port, tested on Windows 10.
BlinkUSB.ino
/*
* Send number to Serial
*/
int i = 0;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
Serial.begin(9600);
}
// the loop function runs over and over again forever
void loop() {
Serial.print(i);
i++;
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Read last post to "Prepare jSSC - download and add library to NetBeans, and create project using jSSC library".
modify the java code, JavaFX_jssc_Uno.java
/*
* Example of using jSSC library to handle serial port
* Receive number from Arduino via USB/Serial and display on Label
*/
package javafx_jssc_uno;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import jssc.SerialPort;
import static jssc.SerialPort.MASK_RXCHAR;
import jssc.SerialPortEvent;
import jssc.SerialPortException;
import jssc.SerialPortList;
public class JavaFX_jssc_Uno extends Application {
SerialPort arduinoPort = null;
ObservableList<String> portList;
Label labelValue;
private void detectPort(){
portList = FXCollections.observableArrayList();
String[] serialPortNames = SerialPortList.getPortNames();
for(String name: serialPortNames){
System.out.println(name);
portList.add(name);
}
}
@Override
public void start(Stage primaryStage) {
labelValue = new Label();
detectPort();
final ComboBox comboBoxPorts = new ComboBox(portList);
comboBoxPorts.valueProperty()
.addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> observable,
String oldValue, String newValue) {
System.out.println(newValue);
disconnectArduino();
connectArduino(newValue);
}
});
VBox vBox = new VBox();
vBox.getChildren().addAll(
comboBoxPorts, labelValue);
StackPane root = new StackPane();
root.getChildren().add(vBox);
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
public boolean connectArduino(String port){
System.out.println("connectArduino");
boolean success = false;
SerialPort serialPort = new SerialPort(port);
try {
serialPort.openPort();
serialPort.setParams(
SerialPort.BAUDRATE_9600,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
serialPort.setEventsMask(MASK_RXCHAR);
serialPort.addEventListener((SerialPortEvent serialPortEvent) -> {
if(serialPortEvent.isRXCHAR()){
try {
String st = serialPort.readString(serialPortEvent
.getEventValue());
System.out.println(st);
//Update label in ui thread
Platform.runLater(() -> {
labelValue.setText(st);
});
} catch (SerialPortException ex) {
Logger.getLogger(JavaFX_jssc_Uno.class.getName())
.log(Level.SEVERE, null, ex);
}
}
});
arduinoPort = serialPort;
success = true;
} catch (SerialPortException ex) {
Logger.getLogger(JavaFX_jssc_Uno.class.getName())
.log(Level.SEVERE, null, ex);
System.out.println("SerialPortException: " + ex.toString());
}
return success;
}
public void disconnectArduino(){
System.out.println("disconnectArduino()");
if(arduinoPort != null){
try {
arduinoPort.removeEventListener();
if(arduinoPort.isOpened()){
arduinoPort.closePort();
}
} catch (SerialPortException ex) {
Logger.getLogger(JavaFX_jssc_Uno.class.getName())
.log(Level.SEVERE, null, ex);
}
}
}
@Override
public void stop() throws Exception {
disconnectArduino();
super.stop();
}
public static void main(String[] args) {
launch(args);
}
}
Next:
- JavaFX + jSSC - read byte from Arduino Uno, read from Analog Input
Wednesday, August 17, 2016
Active Partition Recovery Professional 14 Serial Key STL
Active Partition Recovery Professional 14 Serial Key STL
Active Partition Recovery Professional 14 + Serial Key [STL]

Active@ Partition Recovery toolkit includes the following main features:
- Restores lost partitions & disks back to working state
- QuickScan easily detects partitions being deleted but not re-formatted
- SuperScan - low-level scan detects re-formatted & damaged partitions
- LastChance - recovery method for severely damaged filesystems on volumes
- Backup & Restore disk partitioning info and ability to Rollback changes
- Fixes damaged Partition Table, MBR (Master Boot Record) and GPT
- Creates a Disk Image - sector-by-sector data backup for data recovery
- Restores all data from raw, compressed and VMWare Disk Images
- Supports Windows 7 & 8, XP & Vista, 2003 & 2008 & 2012 Servers, WinPE
- Recovers FAT/exFAT/NTFS/HFS+/UFS/Ext2/Ext3/Ext4/BtrFS file systems
- Recovers IDE, SATA, eSATA, SSD, SCSI, RAID, USB Flash Disks and Memory Cards
- Recovers volumes lost due to accidental disk formatting, damage by virus attack, malicious program, or a power failure...

Download
Password: skylinks
Sunday, August 14, 2016
FreeMake Video Converter Gold v4 1 9 14 Serial
FreeMake Video Converter Gold v4 1 9 14 Serial
Kini, FreeMake Video Converter meluncurkan versi terbarunya yaitu versi 4.1.9.14. Software ini merupakan program komputer untuk mengkonversi video ke AVI, MP4, WMV, MKV, 3GP, DVD, iPad, iPhone, PSP, Android ponsel, dan lain-lain. Dengan interface yang friendly user dan mudah digunakan.
Cara aktivasi
- Download dan install "FreemakeVideoConverterFull.exe" (biasakan Run as Administrator untuk Windows 7 ke atas)
- Matikan koneksi internet (penting)
- Klik pada menu Help dan pilih Get Gold Pack, kemudian klik pada I already have the key
- Buka serial yang sudah disertakan, masukan serial Gold Pack
- Lakukan hal yang sama untuk Get Subtitle Pack
- Done

Download
FreeMake Video Converter Gold setup
Serial key
Sunday, August 7, 2016
7 Data Recovery 3 3 Enterprise Serial Key STL
7 Data Recovery 3 3 Enterprise Serial Key STL
7 Data Recovery 3.3 Enterprise + Serial Key

Complete and capable data recovery software for rescuing files under almost any conditions including: accidentally deleted files; damaged or formatted hard drive; lost/deleted partition; photo or video lost from local drive, memory card, or camera; file lost from mobile phones, etc.
- Recover data from both local drives and mobile storage devices
- Recover documents, emails, photos, videos, audio files and more
- Recover 1 GB data for free with the Free Edition
Install

Scan

Recover

DOWNLOAD
Password: skylinks
Saturday, August 6, 2016
FreeMake Video Converter Gold v4 1 9 10 Serial
FreeMake Video Converter Gold v4 1 9 10 Serial
FreeMake Video Converter merupakan program komputer untuk mengkonversi video ke AVI, MP4, WMV, MKV, 3GP, DVD, iPad, iPhone, PSP, Android ponsel, dan lain-lain. Dengan interface yang friendly user dan mudah digunakan.

Cara aktivasi
- Download dan install "FreemakeVideoConverterFull.exe" (biasakan Run as Administrator untuk Windows 7 ke atas)
- Matikan koneksi internet
- Klik pada menu Help dan pilih Get Gold Pack, kemudian klik pada I already have the key
- Buka serial yang sudah disertakan, masukan serial Gold Pack
- Lakukan hal yang sama untuk Get Serial Pack

Download
FreeMake Video Converter Gold v4.1.9.10 + Serial
New Versi
FreeMake Video Converter Gold v4.1.9.14 + Serial
New Versi
FreeMake Video Converter Gold v4.1.9.14 + Serial
Thursday, July 28, 2016
Arduino Mega read string from Serial display on 3 2 480 x 320 TFT LCD Shield
Arduino Mega read string from Serial display on 3 2 480 x 320 TFT LCD Shield

Arduino example run on Mega 2560, read string from Serial port, and display on 3.2" 480 x 320 TFT LCD Shield usin UTFT library. The sting is limited to 30 characters on each line.
Mega_UTFT_SerialRead.ino
/*
* Example run on Arduino Mega 2560 to read string from Serial,
* then display on 3.2" 480 x 320 TFT LCD Shield
*
* http://arduino-er.blogspot.com/search/label/3.2%22%20480%20x%20320%20TFT%20LCD%20Shield
*/
#include <UTFT.h>
extern uint8_t BigFont[];
UTFT myGLCD(CTE32HR,38,39,40,41);
const int NumOfRow = 20;
const int HeightOfRow = 16;
const int CharPerRow = 30;
String buffer[NumOfRow];
void setup()
{
Serial.begin(57600);
myGLCD.InitLCD();
myGLCD.clrScr();
myGLCD.setColor(255, 255, 255);
myGLCD.setBackColor(0, 0, 0);
myGLCD.setFont(BigFont);
myGLCD.print("Open Serial Monitor,", LEFT, 0);
myGLCD.print("to enter something.", LEFT, HeightOfRow);
initBuffer();
}
void loop()
{
String stringIn = Serial.readStringUntil( );
Serial.print(".");
if(!stringIn.equals("")){
Serial.print("*");
String stringToIns = stringIn.substring(0, CharPerRow);
insert(stringToIns);
Serial.println(stringToIns);
printBuffer();
}
}
void initBuffer(){
for(int i=0; i<NumOfRow; i++){
buffer[i] = "";
}
}
void insert(String ins){
for(int i=0; i<NumOfRow-1; i++){
buffer[i] = buffer[i+1];
}
buffer[NumOfRow-1] = ins;
}
void printBuffer(){
myGLCD.clrScr();
for(int i=0; i<NumOfRow; i++){
myGLCD.print(buffer[i], LEFT, i*HeightOfRow);
}
}
Subscribe to:
Posts (Atom)