Go to advanced search

by danjperron
Tue Jun 18, 2019 1:58 pm
Forum: Automation, sensing and robotics
Topic: DS18B20 resolution
Replies: 14
Views: 430

Re: DS18B20 resolution

I'm just curious! What is the result of my application configDS18B20 git clone https://github.com/danjperron/BitBangingDS18B20 cd BitBangingDS18B20 gcc -o configDS18B20 configDS18B20.c Connect only one sensor to a GPIO pin. Not the GPIO4 but any in IN/OUT mode. Don't forget to power it up with 3.3V ...
by danjperron
Mon Jun 17, 2019 6:45 pm
Forum: Other projects
Topic: ADS1115 is not detected by i2c
Replies: 6
Views: 155

Re: ADS1115 is not detected by i2c

From your picture, are using breakaway male header with wire solder to your ads1115. Looks like wire solder to pin. I don't think that it is stable enough. Also you have another board under your PI3. Your ruban cable looks to be connected at the bottom. Is the connection pin mirrored in that case. I...
by danjperron
Mon Jun 17, 2019 2:23 pm
Forum: Automation, sensing and robotics
Topic: DS18B20 resolution
Replies: 14
Views: 430

Re: DS18B20 resolution

Because the original question on this thread was why some waterproof sensors were producing readings of XX.XX but other sensors were producing readings of XX.XXX I'm sorry but xx.xx is not 0.25! xx.xx imply resolution less than 0.01 but the post is about difference between 0.25 and 0.063 which show...
by danjperron
Mon Jun 17, 2019 1:00 pm
Forum: Automation, sensing and robotics
Topic: DS18B20 resolution
Replies: 14
Views: 430

Re: DS18B20 resolution

Accuracy of the DS18B20 is 0.5 Celsius. Half of a full degree!!! It is normal to get more resolution than accuracy otherwise you couldn't get a good accuracy! At 12 bits you are at 0.0625 Celsius which is a little more than 1 decimal resolution. So why are you looking at 3 decimals when the resoluti...
by danjperron
Sun Jun 16, 2019 10:26 pm
Forum: Automation, sensing and robotics
Topic: DS18B20 resolution
Replies: 14
Views: 430

Re: DS18B20 resolution

You could use my user mode method.


The application configDS18B20 could set your bit resolution.


Use another pin than GPIO4 to set the resolution.

https://github.com/danjperron/BitBangingDS18B20
by danjperron
Sun Jun 16, 2019 6:17 pm
Forum: General discussion
Topic: Running 3 RC522 side by side continuously
Replies: 14
Views: 365

Re: Running 3 RC522 side by side continuously

I'm with mikronauts,

Use a LE33cz or any low drop 3.3v regulator connected to the 5V to power your RC-522 device.
by danjperron
Thu Jun 13, 2019 4:35 pm
Forum: General discussion
Topic: Running 3 RC522 side by side continuously
Replies: 14
Views: 365

Re: Running 3 RC522 side by side continuously

If I wanted to check each device on the same application, I guess I would have to just loop through each chip select every 50 ms or so (based on research that it takes about 50 ms to read). Does that sound right? Just check the read function if the serial ID change. if it does then act on it. You d...
by danjperron
Thu Jun 13, 2019 1:54 pm
Forum: General discussion
Topic: Running 3 RC522 side by side continuously
Replies: 14
Views: 365

Re: Running 3 RC522 side by side continuously

Use a chip select different for each RC522 readers. You will need to check each device on the same application or run three different application by selecting different CHIP select or SPI modules.

The raspberry Pi has multiple SPI modules. Check the /boot/overlays/README for more information.
by danjperron
Tue Jun 11, 2019 6:14 pm
Forum: Python
Topic: Moving 16 servos in a wave
Replies: 11
Views: 342

Re: Moving 16 servos in a wave

Just A question. Why calculating sine value since servos are in facto in angle already! more or less from -90 to 90 degree. Using sine value to calculate the difference between each servo won't provide a nice sinewave. You should instead split the number between the -90 to 90 using linear value. Nor...
by danjperron
Sat Jun 08, 2019 11:59 am
Forum: Beginners
Topic: Reading analog input voltage of 0-30v
Replies: 4
Views: 299

Re: Reading analog input voltage of 0-30v

@W. H. Heydt you forgot to check the link to the interface. It is not connected to the GPIO but to an A/D converter! ;-) A simple resistor divider before your A/D converter will do the trick! A 47K resistor with a 4K7 resistor to ground will reduce the voltage by 1/11. Then a 30V will have 2.727 V. ...
by danjperron
Fri Jun 07, 2019 1:40 pm
Forum: Français
Topic: raspberry pi and sabertooth 2X25
Replies: 34
Views: 5686

Re: raspberry pi and sabertooth 2X25

Il a moyen de contourner le problème de démarrage. Voici une piste possible 1 - Utiliser un 74HCT02 au lieu des deux transistors. une porte pour inverser le signal et la deuxième porte avec un entrée sur une délais de temporisation style LM555. Le délais devrait être plus long pour dépasser la fluct...
by danjperron
Fri Jun 07, 2019 11:36 am
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 565
Views: 15446

Re: A Final Fibonacci Challenge

MacBook-Air-de-Daniel:~ daniel$ ./t1 FFFFFFFF * 80000000 = 7FFFFFFF80000000 That is on your macbook, try it on the RPi and see. C says a mathematical operator only has to return the same type as its operators, the type of variable you are assigning to has no bearing on the types used in the calcula...
by danjperron
Thu Jun 06, 2019 3:09 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 565
Views: 15446

Re: A Final Fibonacci Challenge

Maybe so, but to use Python 3, your program should start Code: Select all #!/usr/bin/env python3 They're best thought of as two completely separate languages, united by a common fear of HTML text normalization. Yes this is a mistake of my part. ;-( I Always using the correct python interpreter on t...
by danjperron
Wed Jun 05, 2019 11:26 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 565
Views: 15446

Re: A Final Fibonacci Challenge

For PHP ! Another approach! 1T bytes SSD or a cheaper HHD. Your current algorithm figure out fibo using pre-calculated fibonacci number with lower values. Then how long it will take to fill it with all possible number up to the maximum size of the drive. This way the return value will be fast. and i...
by danjperron
Wed Jun 05, 2019 11:07 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 565
Views: 15446

Re: A Final Fibonacci Challenge

@Paeryn Yes that version has some bugs . But Code: Select all realloc(fibs, sizeof(Fibs_struct)*fibs_size); Do you really want to realloc fibs and throw away it's new location if it got moved? Then What do I do? if the fibo ask is only 1 and the other 10000000. You have v declared as unsigned long l...
by danjperron
Tue Jun 04, 2019 6:27 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 565
Views: 15446

Re: A Final Fibonacci Challenge

No idea, I never use Python. But the "python" command here uses python2. After a while I was wondering why it was not finishing... Now you know why I put days or month on it. I was thinking that could be a good approach because is only one calculation but each variable contains a lot of significant...
by danjperron
Tue Jun 04, 2019 6:17 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 565
Views: 15446

Re: A Final Fibonacci Challenge

this is on python2 MacBook-Air-de-Daniel:~ daniel$ time python fibo2.py 10 55 real 0m0.056s user 0m0.034s sys 0m0.015s MacBook-Air-de-Daniel:~ daniel$ time python fibo2.py 100 354224848179261915075 real 0m0.060s user 0m0.036s sys 0m0.015s MacBook-Air-de-Daniel:~ daniel$ time python fibo2.py 1000 434...
by danjperron
Tue Jun 04, 2019 6:10 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 565
Views: 15446

Re: A Final Fibonacci Challenge

danjperron's Python solution using the Golden Ratio is not in the Gighub repository:
You mean is now! ;-)

thanks!

python2!!! Why bother ?? You know that python2 will be end of life very soon
https://pythonclock.org/
by danjperron
Tue Jun 04, 2019 5:37 am
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 565
Views: 15446

Re: A Final Fibonacci Challenge

ok I made one in C using tables of 32bits digits. It is not finished since I need to convert the result from hex to decimal. But it is blazzing fast. This version uses the same method than fibo.py. Since you don't want gmp, I made my own multiply and add fonction. #include <stdlib.h> #include <stdio...
by danjperron
Tue Jun 04, 2019 2:18 am
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 565
Views: 15446

Re: A Final Fibonacci Challenge

rounded to the nearest integer to obtain the exact value. It is possible that this trick only works when n is large enough, but I haven't checked. nope it works even with small numbers MacBook-Air-de-Daniel:~ daniel$ python fibo2.py 2 1 MacBook-Air-de-Daniel:~ daniel$ python fibo2.py 3 1.8944271909...
by danjperron
Tue Jun 04, 2019 12:51 am
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 565
Views: 15446

Re: A Final Fibonacci Challenge

Wait, hang on - how does using any sort of approximation via a floating point number produce a correct answer to an integer problem? Surely that can't be right? Decimal module in python is different from normal floating point. You are able to assign N numbers of decimals. This is why it is so slow....
by danjperron
Mon Jun 03, 2019 10:29 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 565
Views: 15446

Re: A Final Fibonacci Challenge

Do you mind if I add your solution to the Fibonacci Challenge hall of fame: https://github.com/ZiCog/fibo_4784969 not at all Do you have a place were you have the 1 millions digit from fibo(4784969). I want to compare yours against mine to be sure that all digits are the same!. I think that you are...
by danjperron
Mon Jun 03, 2019 8:21 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 565
Views: 15446

Re: A Final Fibonacci Challenge

People have been calculating fibo(4784969) here, which is a million digits! So! Are you able to do it ? And How long it takes ? In reality you could calculate any number you want but it will take times. I will check how long it takes the pi to calculate fibo(4784969). Hum a week, a month? #!/usr/bi...
by danjperron
Mon Jun 03, 2019 7:18 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 565
Views: 15446

Re: A Final Fibonacci Challenge

Calculating Fibo(n) could be optimize using

F(n) = phi ** n / sqrt(5)

where phi is the golden number. phi = ( 1 + sqrt(5))/2


Calculation of Fibo(2149831) needs at least 449288 digits of precision. Does your computer could handle it ?
by danjperron
Fri May 31, 2019 8:39 pm
Forum: Troubleshooting
Topic: How display all pics from FTP address in php
Replies: 4
Views: 119

Re: How display all pics from FTP address in php

The php script is for a full ftp connection with user and password but you just had to select anonymous and no password (your email has password normally). This function will extract all files with (".jpg") from the subdirectory. This is a very very very simple php script so try to figure it out! Th...

Go to advanced search