Go to advanced search

by nizam
Fri Oct 17, 2014 8:37 am
Forum: C/C++
Topic: C using MMAP I/O for raspberry pi
Replies: 6
Views: 3121

Re: C using MMAP I/O for raspberry pi

Thanks Joan. I follow your advice and end up rewrite back my code. But still the same problem appear. this my code. #include <sys/time.h> int main(int argc, char **argv) { int distance; struct timeval start,end;; double elapsed ; // Set up gpi pointer for direct register access setup_io(); INP_GPIO(...
by nizam
Fri Oct 17, 2014 6:02 am
Forum: C/C++
Topic: C using MMAP I/O for raspberry pi
Replies: 6
Views: 3121

Re: C using MMAP I/O for raspberry pi

Thanks for replying my post. I didn't get any error. But when compiling there seems like it stuck. It should be state the distance detected from the ultrasonic sensor but it doesn't come out :(
by nizam
Fri Oct 17, 2014 3:18 am
Forum: C/C++
Topic: C using MMAP I/O for raspberry pi
Replies: 6
Views: 3121

C using MMAP I/O for raspberry pi

I try to follow the gerboard manual but still without using the gertboard, only by using raspberry pi. Could somebody tell me what is wrong with it? I already compile it but there is nothing.This is the code I took from Gert van Loo and Dom blinking LED code and use it for ultrasonic sensor.Anyway t...
by nizam
Fri Aug 22, 2014 12:36 pm
Forum: Python
Topic: Ultrasonic Sensor Problems
Replies: 18
Views: 6474

Re: Ultrasonic Sensor Problems

thanks joan... this time i had some trouble with installing your library to my other rpi.
it says can't lock /var/run/crond.pid pigpio initialisation failed
It appears when i run sudo ./x_pigpio and sudo pigpiod
Where should i initialise it?
by nizam
Wed Aug 20, 2014 5:24 am
Forum: Python
Topic: Ultrasonic Sensor Problems
Replies: 18
Views: 6474

Re: Ultrasonic Sensor Problems

A million thanks Joan...

Is it true that python language is a bit slow compare to C language?
Btw Im working and trying on changing the code to my old code. Pray for me though..coz Im a noob programmer :(
by nizam
Tue Aug 19, 2014 5:00 am
Forum: Python
Topic: Ultrasonic Sensor Problems
Replies: 18
Views: 6474

Re: Ultrasonic Sensor Problems

:o :o :o :o :o :o :o :o Thanks Joan , may god bless you.. The result is amazing. Speechless*.....Thanks x1000000 sorry but I have a few more questions for you. 1) Why the result is stable? Is it because you make the library from C , thus making it work faster and stable compare to GPIO.library? 2) B...
by nizam
Mon Aug 18, 2014 8:36 am
Forum: Python
Topic: Ultrasonic Sensor Problems
Replies: 18
Views: 6474

Re: Ultrasonic Sensor Problems

I use the servos library to stable the trigger signal. And the result is better compare by using a gpio library. When i used gpio library, it always freeze suddenly. From my research , python is a bit slow compare to others , that is why the ultrasonic sensor freeze suddenly( i dun know whether this...
by nizam
Mon Aug 18, 2014 6:33 am
Forum: Python
Topic: Please Help This Noob
Replies: 3
Views: 682

Please Help This Noob

Hi , Im a programming beginner. About python, does anyone know references regarding python. For example, i like to make a coding of taking previous and present real-time data and median of it. Thanks for helping me :(
by nizam
Mon Aug 18, 2014 1:39 am
Forum: Python
Topic: Ultrasonic Sensor Problems
Replies: 18
Views: 6474

Re: Ultrasonic Sensor Problems

Thanks joan.. I already read your link. But my hc-sr04 was tested in fixed condition actually. If i'm wrong please correct me :(. From the graph, i tested within 7 cm range, but the results is terrible :( . Is it because my time.sleep (10ms) ? Btw this is my code #!/usr/bin/python2 import RPi.GPIO a...
by nizam
Sat Aug 16, 2014 12:44 am
Forum: Python
Topic: Ultrasonic Sensor Problems
Replies: 18
Views: 6474

Re: Ultrasonic Sensor Problems

Thanks Joan for your reply. I appreciate it very much :) Your smoothing method is great but as you can see my readings vary too much. First , i think because of the signal is not stable by using GPIO.setup library. So, I use RPIO.setup and it's getting better. But still the readings vary too much. S...
by nizam
Thu Aug 14, 2014 7:48 am
Forum: Python
Topic: Ultrasonic Sensor Problems
Replies: 18
Views: 6474

Ultrasonic Sensor Problems

hi im a beginner in programming and currently working with hc-sr04 and raspberry pi.
I just wanna your opinion on how to filter the hc-sr04 result.
i wanna take its previous data if the present data is too impossible. What is the best algorithm? or do u hav any opinion?
by nizam
Sun Aug 03, 2014 11:51 pm
Forum: Python
Topic: problems with HC-SR04 ultrasonic sensor
Replies: 2
Views: 1120

Re: problems with HC-SR04 ultrasonic sensor

That is an infinite loop although it will try printing the distance about 200 times a second which isn't going to happen so you may want to add a sleep after the print. Dave. thanks dave. I already put time.sleep(0.05) after print..but still it stop and give unstable reading. Thanks again for reply...
by nizam
Thu Jul 31, 2014 3:39 am
Forum: Python
Topic: Ultrasonic sensor script hang up random
Replies: 15
Views: 4181

Re: Ultrasonic sensor script hang up random

i`m sorry for interrupt .. actually i have just the same problem as you.. still about the "hang up result" is not solved. but the 3rd one is, my sensor doesnt give me a stable reading...for example if we measure a 3cm sometimes it become 10 or 15 cm or maybe worse. and I have copy/paste this script ...
by nizam
Thu Jul 31, 2014 1:55 am
Forum: Python
Topic: problems with HC-SR04 ultrasonic sensor
Replies: 2
Views: 1120

problems with HC-SR04 ultrasonic sensor

hi, im just a noob in robotics. im doing a research on robotic and ultrasonic sensor. When using a hc-sr04 and connected to raspberry pi with 50ms and lower time.sleep, my data seems not very stable. I want to use an infinite loop for my sensor..but i dun know how to use it using python..btw this is...
by nizam
Wed Jul 30, 2014 1:59 am
Forum: Automation, sensing and robotics
Topic: Problems with the HC-SR04 Ultrasonic Sensor
Replies: 15
Views: 19825

Re: Problems with the HC-SR04 Ultrasonic Sensor

hi,
im a beginner i robotic and sensor.
im doing a research on robotic and ultrasonic sensor. When using a hc-sr04 and connect to raspberry pi with 25ms time.sleep, my data seems not very stable. Is it ordinary case or it just an usual one?

Go to advanced search