Go to advanced search

by tony1812
Fri Oct 19, 2018 2:30 pm
Forum: Java
Topic: How to link java program logic to UI in netbeans
Replies: 1
Views: 412

How to link java program logic to UI in netbeans

Hello. I just started self-taught Java on netbeans. I failed to understand how a program logic is related to the gui. In the code below, I want the user be able to click on a jbutton object, then the code will send a char '1' to the HC-05 serial port. The structure on netbeans is like this attached ...
by tony1812
Fri Oct 05, 2018 11:04 pm
Forum: Beginners
Topic: HC-05 and Pi
Replies: 11
Views: 360

Re: HC-05 and Pi

Thank you all for the quick replies. :) I don't recall I had to play with the PIO11 last time. Under AT+UART mine is 38400,1,0 should it be 38400,0,0? Also on the rx line of the JC-05. do I need a voltage divider? Some tutorial say yes but yet many don't and I don't recall I use it in the last time ...
by tony1812
Fri Oct 05, 2018 10:10 pm
Forum: Beginners
Topic: HC-05 and Pi
Replies: 11
Views: 360

HC-05 and Pi

Hi, A year ago, I was able to get the Pi communicate with an arduino wirelessly through HC-05. But I totally forget how I did it. I got into AT mode set the AT+ROLE = 1(master), but the pi won't detect it. However if I set AT+ROLE =0(slave) the pi detects it immediately. Shouldn't the HC-05 be set t...
by tony1812
Sat Sep 29, 2018 6:15 pm
Forum: Java
Topic: serial communication with java
Replies: 4
Views: 607

Re: serial communication with java

Haha, I read so many tutorials I fogot where they come from. But definitely not the you links you sent. Thank you for that.I have been trying to look into the methods in Adriuno .jar, that really helps. :)
by tony1812
Sat Sep 29, 2018 4:35 pm
Forum: Java
Topic: serial communication with java
Replies: 4
Views: 607

Re: serial communication with java

Thanks for the reply. Yes, I did read the link you sent, but I failed to relay it to these two .jars Arduino.jar and jserialcomm.jar. In the Java code since I am using an arduino object -- Arduino a = new Arduino(); I wrote a.serialWrite(num) to send a number to Arduino, shouldn't there be a corresp...
by tony1812
Fri Sep 28, 2018 9:35 pm
Forum: Java
Topic: serial communication with java
Replies: 4
Views: 607

serial communication with java

Hello, for exercise purpose, I worte a simple code using java to communicate with Arduino. In the Java code, I use arduino.jar and jserialcomm.jar, I could get java to send out command to arduino, 1 turns on a white led, 2 turns on a red led 3 read a string from arduino. The first two work just fine...
by tony1812
Fri Sep 28, 2018 10:21 am
Forum: Java
Topic: python time.sleep(x) in java
Replies: 3
Views: 519

Re: python time.sleep(x) in java

Please don't give me the attitude. I did google it, I read the same post. but My little understanding is Thread.sleep() has something to do with a thread.. I am wondering if it can be applied to general purpose like time.sleep() in python.

I am not a genius like you. Java is brand new to me.
by tony1812
Thu Sep 27, 2018 11:39 pm
Forum: Java
Topic: python time.sleep(x) in java
Replies: 3
Views: 519

python time.sleep(x) in java

Hello, in python, when I need to call a delay action, I can use time.sleep(x). What is it in Java?
Thread.sleep() ? Thanks.
by tony1812
Thu Sep 27, 2018 6:30 pm
Forum: Java
Topic: where to put .jar?
Replies: 4
Views: 606

Re: where to put .jar?

DougieLawson wrote:
Thu Sep 27, 2018 3:26 pm
It needs to be in a folder in your CLASSPATH or -cp when you try to run it. Java will only look for a jar file in folders defined on the CLASSPATH.
That's what I figure.
How do I create this CLASSPATH?
by tony1812
Thu Sep 27, 2018 2:10 pm
Forum: Java
Topic: where to put .jar?
Replies: 4
Views: 606

where to put .jar?

Hello, I just started to learn java. I have a basic question. I don't want to use any IDEs, I want to use the Terminal to compile my jave code was written in a simple text editor. i wrote which require to import a .jar to the library. when I compile it in terminal, javac XYZ.java, where should the ....
by tony1812
Thu Sep 27, 2018 12:39 pm
Forum: Python
Topic: python on serial port
Replies: 1
Views: 114

python on serial port

Hello. I wrote a very simple piece of code. all it does is when enter a 1 in serial monitor the the LED blinks for 1 second. void setup() { Serial.begin(9600); pinMode(12, OUTPUT); } void loop() { if (Serial.available()) { if(Serial.read()=='1') { digitalWrite(12, HIGH); delay(1000); digitalWrite(12...
by tony1812
Tue Sep 25, 2018 11:42 pm
Forum: Java
Topic: NetBean IDE questions
Replies: 1
Views: 559

NetBean IDE questions

Hello, I just started to use NetBeans 8.2. I have a project, I would like to add two more .jar to Libraries. Question #1 seems to more related to the Mac, I have two .jar files, somehow they automaticly go into a wired thing called Developer, when I click on it, it turns into a folder called "New Fo...
by tony1812
Tue Sep 25, 2018 11:41 am
Forum: Java
Topic: jseralcomm
Replies: 1
Views: 472

jseralcomm

Hi, I just started to learn java, I have a silly question, in java when it says import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStream; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListen...
by tony1812
Mon Sep 03, 2018 5:22 pm
Forum: Beginners
Topic: strange thing happens (config.txt empty after edit)
Replies: 5
Views: 169

Re: strange thing happens

Hmmm, I realized one thing, I transfer the /boot/config.txt from my pi to my Mac ( my Mac has BBEdit) all the text are intacted. But when I load the same file to my pi3 open it with pi3's text editor or nano or leafpad, all text dispeared. I can only thing it is some king on text encoding the pi doe...
by tony1812
Mon Sep 03, 2018 4:01 pm
Forum: Beginners
Topic: strange thing happens (config.txt empty after edit)
Replies: 5
Views: 169

strange thing happens (config.txt empty after edit)

Hello, I use vnc on Mac to my Pi3, edited the /boot/config.txt, then I use the same SD but boot it up on another pi 3 with a 7" official Pi LCD, the odd thing happened, the /boot/config.txt is all empty, all text are gone, but the pi still boot up. What happen?
by tony1812
Sun Aug 19, 2018 11:59 pm
Forum: Beginners
Topic: Unable to fetch some archives
Replies: 7
Views: 340

Re: Unable to fetch some archives

I have the same problem the last couple of days. Trying again later seems to work. How much later? Can be minutes or the next day. On and off, when I do update and upgrade, I had similar error messages in the past. I wonder if the problem exist on the repository? Perhaps it is managed by some newbi...
by tony1812
Sun Aug 19, 2018 11:56 pm
Forum: Beginners
Topic: Unable to fetch some archives
Replies: 7
Views: 340

Re: Unable to fetch some archives

"Last modification reported: Fri, 17 Aug 2018 16:40:06 +0000 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?" Odd... I would expect lines with the actual archives it is trying to read / download, etc... Are you sure *all* the output consists of just those 2 lin...
by tony1812
Sun Aug 19, 2018 9:10 pm
Forum: Beginners
Topic: Unable to fetch some archives
Replies: 7
Views: 340

Re: Unable to fetch some archives

yea sudo update
sudo upgrade

This is the entire error message
"Last modification reported: Fri, 17 Aug 2018 16:40:06 +0000
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?"
by tony1812
Sun Aug 19, 2018 3:06 pm
Forum: Beginners
Topic: Unable to fetch some archives
Replies: 7
Views: 340

Unable to fetch some archives

Hello, quit often when I update and grade my pi, I get error like this: Last modification reported: Fri, 17 Aug 2018 16:40:06 +0000 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? Why is that? Is there something wrong with the repository? Is there anything I can...
by tony1812
Mon Jul 16, 2018 3:27 am
Forum: Automation, sensing and robotics
Topic: 16-channel PWM & Servo driver and pi3
Replies: 3
Views: 257

16-channel PWM & Servo driver and pi3

Hello, I am doing a robotic project. I have an old robot wth 12 servos. it was using and Arduino nano with a 16-channel PWM & Servo driver. Now I would like to substitude the Arduino with a Pi3 or Pi zero, as the Pi has a limited hardware PWM, Would it be better to use this 16-channel PWM & Servo dr...
by tony1812
Thu Jun 14, 2018 12:25 pm
Forum: Beginners
Topic: remove/delete all dependencies
Replies: 3
Views: 252

Re: remove/delete all dependencies

Did the install instructions have "make install" or something like that in? Because sometimes there are "make uninstall" options as well. No it doesn't. but it does have a uninstall.sh in it. when I run ./uninstall.sh, seemingly it just remove the desktop icon, I am not sure if it removes every dep...
by tony1812
Thu Jun 14, 2018 12:15 pm
Forum: Beginners
Topic: Arduino ide does not launch on pi3 stretch.
Replies: 5
Views: 647

Re: Arduino ide does not launch on pi3 stretch.

did you install from the repo, or get the (much newer, much better) version from https://www.arduino.cc/en/Main/Software ? +1 The version in the Debian/Mint/Ubuntu/Raspbian repos is a piece of junk - it won't work with ESP8266s. Grabbing the version from https://www.arduino.cc/download_handler.php?...
by tony1812
Wed Jun 13, 2018 11:41 pm
Forum: Beginners
Topic: Arduino ide does not launch on pi3 stretch.
Replies: 5
Views: 647

Arduino ide does not launch on pi3 stretch.

Hello, its been awhile since I do anything on the pi3 with arduino IDE. Today I fired up the arduino ide, I click on it, it is as if it was going to open, but after a while, the hourglass vanished, the IDE does not open. I also re-installed arduino IDE and I did update and upgrade to the latest of s...
by tony1812
Wed Jun 13, 2018 1:14 pm
Forum: Beginners
Topic: remove/delete all dependencies
Replies: 3
Views: 252

remove/delete all dependencies

Hello, I installed serval software from tar, not apt install package, one of them is the Arduino IDE. Now I need to delete it. But the arduino related files are all over the place after the installation and I can't use apt remove them. How can I clean out all Arduino related files?
by tony1812
Fri Jun 08, 2018 8:03 pm
Forum: Beginners
Topic: 7" official pi LCD ribbon
Replies: 1
Views: 107

7" official pi LCD ribbon

Hello, does anyone know how to buy the 7" official pi LCD ribbon? the ribbon between the pi and the LCD circuit board. On eBay they all sold with the LCD, not just the ribbon itself. Thanks.

Go to advanced search