Go to advanced search

by Ferdinand
Tue Jun 28, 2016 1:04 pm
Forum: Python
Topic: Automatic light switch script
Replies: 22
Views: 3574

Re: Automatic light switch script

Hi RaspbianSalvation ,

You may use the following commands:

Code: Select all

# minutes
from random import randint
print(randint(0,59))

# hours
from random import randint
print(randint(18,24))
Success with coding!!!
by Ferdinand
Tue Jun 28, 2016 11:32 am
Forum: Python
Topic: Automatic light switch script
Replies: 22
Views: 3574

Re: Automatic light switch script

H RaspbianSalvation, I corrected some "errors" in your code. Watch the lines that begins with # !!!!! #!/usr/bin/python import time import RPi.GPIO as GPIO GPIO.setwarnings(False) #Define Relay outputs # R1 = 17 # !!!!!! Remove this line! #Define relay on times R1ONH = 21 R1ONM = 0 R1ONS = 0 #Define...
by Ferdinand
Sun Jun 26, 2016 2:04 pm
Forum: General discussion
Topic: I2C addresses
Replies: 2
Views: 689

Re: I2C addresses

Hi johnmitakz, ... start on 0x68 for the first adc and then 0x69 for the next, etc. They just increment without making a difference between read and write. How come that this works? 0x68 is not the first adc but it addresses to a block of 4 adc's and configuration register, 0x69 addresses to the nex...
by Ferdinand
Thu Jun 23, 2016 10:08 am
Forum: Troubleshooting
Topic: raspberry gpio input resets to 0v
Replies: 14
Views: 2046

Re: raspberry gpio input resets to 0v

Hi fisherijus, Did you read the datasheet of MCP23017? See for more info: http://ww1.microchip.com/downloads/en/DeviceDoc/21952b.pdf The operating voltage (VDD) of the MCP23017 is from 1.8V to 5.5 V. So you may apply 3.3 V to the VDD pin. But i think that you have to clear the interrupt register of ...
by Ferdinand
Thu May 26, 2016 4:25 pm
Forum: Automation, sensing and robotics
Topic: GPIO Input
Replies: 12
Views: 2051

Re: GPIO Input

2.5 uS
by Ferdinand
Thu May 26, 2016 12:06 pm
Forum: Automation, sensing and robotics
Topic: GPIO Input
Replies: 12
Views: 2051

Re: GPIO Input

Hi fishwolf,

Could you post your code to eliminate 'errors', otherwise it is very hard why your setup is not working properly.
by Ferdinand
Wed May 25, 2016 12:12 pm
Forum: Python
Topic: Help With Time
Replies: 13
Views: 2643

Re: Help With Time

I made a mistake in the code. #!/usr/bin/python # remarks #http://www.tutorialspoint.com/python/python_date_time.htm #https://docs.python.org/2/library/time.html import RPi.GPIO as GPIO import time GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) GPIO.setup(7,GPIO.OUT) #Defining localTime before whi...
by Ferdinand
Wed May 25, 2016 9:13 am
Forum: Python
Topic: Help With Time
Replies: 13
Views: 2643

Re: Help With Time

"012" < "100" gives True :lol:
by Ferdinand
Wed May 25, 2016 6:56 am
Forum: Python
Topic: Help With Time
Replies: 13
Views: 2643

Re: Help With Time

Hi direfulfoil23, You need to copy the localTime assignment inside the while loop and not move. A move will cause the following error: name 'localTime' is not defined I changed this assignment if localTime >= "13" and localTime <= "15": #from 13.00 - 16.00 into if localTime >= "13" and localTime < "...
by Ferdinand
Mon May 23, 2016 8:04 pm
Forum: Automation, sensing and robotics
Topic: Reed Switch Anemometor
Replies: 23
Views: 5077

Re: Reed Switch Anemometor

Oeps, very old post. :o
by Ferdinand
Mon May 23, 2016 1:06 pm
Forum: Automation, sensing and robotics
Topic: Reed Switch Anemometor
Replies: 23
Views: 5077

Re: Reed Switch Anemometor

Hi xicarusx, You have to place input_value = io.input(4) inside the while loop. If you are reading zero's means that you don't have a pullup resistor properly installed. Double check your diagram. An external pullup of pulldown resistor is not required because the rpi pins contain pullup/pulldown ci...
by Ferdinand
Mon May 23, 2016 10:40 am
Forum: Python
Topic: Help With Time
Replies: 13
Views: 2643

Re: Help With Time

Hi direfulfoil23, I suppose that you want to readout hours. Is that right? I do advise you to read the following documents: http://www.tutorialspoint.com/python/python_date_time.htm https://docs.python.org/2/library/time.html Read the code very carefully because I did corrected some mistakes in your...
by Ferdinand
Mon May 23, 2016 6:49 am
Forum: Python
Topic: LOOPING A PROGRAM (HELP)
Replies: 5
Views: 1544

Re: LOOPING A PROGRAM (HELP)

Hi monty8604,

It was a pleasure to help you and I wish you a good time with your daughter!!!
by Ferdinand
Sun May 22, 2016 8:21 am
Forum: Python
Topic: GPIO pin for ENTER
Replies: 10
Views: 2087

Re: GPIO pin for ENTER

Hi pj,

This post contains a code for reading a gpio pin. Perhaps you can use it.
viewtopic.php?f=32&t=148932

Success with your project.
by Ferdinand
Sat May 21, 2016 2:19 pm
Forum: Python
Topic: LOOPING A PROGRAM (HELP)
Replies: 5
Views: 1544

Re: LOOPING A PROGRAM (HELP)

Hi monty8604, Perhaps this program will help you. It is based on a common anode RGB led. If you have a common cathode led "google" is your friend. Download the PDF "Introduction to Python Programming" from https://nclab.com/python-resources/ it's a very good tutorial. Don't forget to visit http://ww...
by Ferdinand
Tue May 17, 2016 6:21 pm
Forum: Advanced users
Topic: Measure power consumption
Replies: 1
Views: 582

Re: Measure power consumption

Hi,

If you measure the current then you can calculate the power.
See:
https://www.eevblog.com/projects/ucurrent/

Success with your project!
by Ferdinand
Fri May 06, 2016 7:26 am
Forum: Python
Topic: Problem regarding testing tactile buttons with Python
Replies: 6
Views: 1197

Re: Problem regarding testing tactile buttons with Python

Hi cre8ive,

I tested your (modified) software on my Pi and replaced tactile switches by short wires on a breadboard.
It runs as aspected. I am pretty sure now that you have a hardware problem. Connect a breadboard directly to your RPi header without T-cobbler.

Success with your project!
by Ferdinand
Fri May 06, 2016 6:35 am
Forum: Python
Topic: Problem regarding testing tactile buttons with Python
Replies: 6
Views: 1197

Re: Problem regarding testing tactile buttons with Python

Hi cre8ive, Is button 1 connected to pin 11 of the raspberry pi header? Is button 2 connected to pin 13 of the raspberry pi header? Is button 3 connected to pin 35 of the raspberry pi header? Is button 4 connected to pin 37 of the raspberry pi header? I think that you mixed up BOARD and BCM numberin...
by Ferdinand
Thu May 05, 2016 9:35 am
Forum: General discussion
Topic: Faulty GPIO pins
Replies: 2
Views: 673

Re: Faulty GPIO pins

Hi abhi91, Your are using BOARD numbering instead of BCM numbering so change the following variables for GPIO.BCM: CLK = 11 #gpio11 => rpi pin header 23 MISO = 9 #gpio9 => rpi pin header 21 MOSI = 10 #gpio10 => rpi pin header 19 CS = 8 #gpio8 => rpi pin header 24 and in the first line i of import RP...
by Ferdinand
Sun May 01, 2016 1:13 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Can't get serial port working
Replies: 25
Views: 50114

Re: Can't get serial port working

watchdogtimer wrote:
but I believe he says UART is now on pins 14 & 15
Hi watchdogtimer,

pin 14 on the hearder is GPIO22 and pin 15 is GND. It's not possible to map Tx and Rx to these pins.
GPIO14 is Tx (pin 8) and GPIO15 is Rx (pin 10), so it's very confusing.
by Ferdinand
Sun May 01, 2016 6:44 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Can't get serial port working
Replies: 25
Views: 50114

Re: Can't get serial port working

Good morning OP, watchdogtimer and all other users, I'm facing the same problem on my RPi3, no problems on my RPi2. See for more info: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=138223 https://blog.adafruit.com/2016/03/07/raspberry-pi-3-uart-speed-workaround I did a clean install off J...
by Ferdinand
Tue Apr 26, 2016 10:14 am
Forum: Advanced users
Topic: Resize image for use on a smaller sd card
Replies: 37
Views: 109966

Re: Resize image for use on a smaller sd card

Hi Hauschild,

You will find all answers here on this excellent site:
http://softwarebakery.com/shrinking-images-on-linux
by Ferdinand
Thu Apr 21, 2016 12:38 pm
Forum: Beginners
Topic: 433Mhz receiver and Raspberry
Replies: 21
Views: 16589

Re: 433Mhz receiver and Raspberry

Hi GhostMaster75, wiringPi was already installed (I also tried to re-install it) and the tutorials I had already seen and followed without success Perhaps I'm missing some info, but I don't see any reference in your code to wiringpi or other serial library. You use in your code 'RECEIVE_PIN = 13', t...
by Ferdinand
Thu Apr 21, 2016 10:40 am
Forum: Beginners
Topic: 433Mhz receiver and Raspberry
Replies: 21
Views: 16589

Re: 433Mhz receiver and Raspberry

Hi GhostMaster75, I'm missing a library wich controls serial input and serial output data streams. Many scripts are based on wiringPi git.drogon.net/wiringPi . A short manual you will find on this site: http://www.princetronics.com/how-to-read-433-mhz-codes-w-raspberry-pi-433-mhz-receiver/ Extra inf...
by Ferdinand
Wed Apr 20, 2016 1:57 pm
Forum: General discussion
Topic: Temperature Detecting System
Replies: 16
Views: 3270

Re: Temperature Detecting System

Hi abhi91 , I modified your script with a timer. The timer is set to 1 hour in variable max_time. Your thermocouple readings are saved in a file called: excel.txt You have to change the format of excel.txt file. Use google to search for "import text file into excel" for the right syntax. You may add...

Go to advanced search