Go to advanced search

by joan
Sun Jan 13, 2019 5:07 pm
Forum: General programming discussion
Topic: smoother RGBW LED fading
Replies: 5
Views: 250

Re: smoother RGBW LED fading

PWM has two attributes. 1) the frequency, and 2) the number of steps between on and off. With pigpio if you drop the frequency there will be more steps between on and off. E.g. see http://abyz.me.uk/rpi/pigpio/pigs.html#PFS and http://abyz.me.uk/rpi/pigpio/pigs.html#PRG (there are similar functions ...
by joan
Sat Jan 12, 2019 9:57 pm
Forum: Troubleshooting
Topic: GPIO many PINs stuck on HIGH state
Replies: 4
Views: 119

Re: GPIO many PINs stuck on HIGH state

Try https://elinux.org/R-Pi_Troubleshooting#Testing with nothing connected to the expansion header GPIO.
by joan
Fri Jan 11, 2019 8:31 pm
Forum: General discussion
Topic: Python Classes - strange behaviour
Replies: 2
Views: 116

Re: Python Classes - strange behaviour

HTML ignores white space. You need to wrap code in code tags (available from the menu bar in the edit window). def candidate_count(self): self.block_sum = [] for cell_item in self.block_cells: self.block_sum += cell[cell_item].candidates self.block_candidate_count = Counter(self.block_sum) return se...
by joan
Fri Jan 11, 2019 5:28 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Making Arduino as Slave with 4 Wire SPI
Replies: 10
Views: 451

Re: Making Arduino as Slave with 4 Wire SPI

It would make things clearer if you go "all the way" to SPI spec. Mainly this - RPi is SPI master and works with SPI bus using pull- up resistors. hence the "power" comes via pull-ups FROM RPi. Most CMOS devices can tolerate +5V anyway internally. SPI does not require pull-ups as all inputs/outputs...
by joan
Mon Jan 07, 2019 3:41 pm
Forum: Beginners
Topic: Pi 3 B+ as SPI slave
Replies: 4
Views: 128

Re: Pi 3 B+ as SPI slave

The Pi has three hardware peripherals which support SPI with the Pi as master (only two are accessible via the expansion header GPIO). They do not support slave mode. The Pi has one hardware peripheral which supports I2C/SPI in slave mode. It works in I2C slave mode. It does not work in SPI slave mo...
by joan
Mon Jan 07, 2019 8:34 am
Forum: Troubleshooting
Topic: 5V on GPIO pin 1
Replies: 32
Views: 590

Re: GPIO pin 1

Kduck wrote:
Sun Jan 06, 2019 8:25 pm
You are both correct on the on the #1 pin I was talking about.
We can't both be correct. Please clarify the pin you mean using the https://pinout.xyz/ diagram.
by joan
Sun Jan 06, 2019 6:00 pm
Forum: Troubleshooting
Topic: 5V on GPIO pin 1
Replies: 32
Views: 590

Re: GPIO pin 1

I have no idea what you mean by pin 1.

Is it pin 1 (3V3) as shown on https://pinout.xyz/ ?
by joan
Sat Jan 05, 2019 1:08 pm
Forum: General discussion
Topic: Flow Meter YF-S201
Replies: 2
Views: 79

Re: Flow Meter YF-S201

Why don't you use one of the countless examples available via a web search? If you don't understand them what is the point of anyone repeating the information here? You really need to do something yourself before asking for help.
by joan
Sat Jan 05, 2019 9:17 am
Forum: Beginners
Topic: Configure GPIO pins input high
Replies: 5
Views: 179

Re: Configure GPIO pins input high

When you set a GPIO as an input its level depends on what you have connected to the GPIO. What have you connected to the GPIO?

Which GPIO are you using and how are you checking its level?
by joan
Thu Jan 03, 2019 9:59 pm
Forum: Beginners
Topic: Pi 3 B+ as SPI slave
Replies: 4
Views: 128

Re: Pi 3 B+ as SPI slave

The Pi only supports being the SPI master. If you want to use the Pi as a SPI slave you will have to bit bang the interface in software. Of course this will only work for low bit rates as you need to ensure you can react to the clock in a timely fashion. The Pi does have a peripheral which is docume...
by joan
Thu Jan 03, 2019 8:52 am
Forum: Other projects
Topic: 150 MHz clock generator using RPi Zero W
Replies: 1
Views: 83

Re: 150 MHz clock generator using RPi Zero W

What advantages does this provide over the Pi's hardware clocks available on GPIO4?
by joan
Sat Dec 29, 2018 1:07 pm
Forum: General discussion
Topic: Python timing...
Replies: 3
Views: 116

Re: Python timing...

You could use pigpio waves to generate the pulses if you want accurate timing.

http://abyz.me.uk/rpi/pigpio/python.htm ... dd_generic
by joan
Sat Dec 29, 2018 1:03 pm
Forum: Python
Topic: GPIO.add_event_detect with bouncetime Trace false tick
Replies: 2
Views: 108

Re: GPIO.add_event_detect with bouncetime Trace false tick

A mechanical switch bounce probably has quite lengthy edges. You could use piscope to capture and see the edges.

http://abyz.me.uk/rpi/pigpio/piscope.html

An alternative would be to run http://abyz.me.uk/rpi/pigpio/examples.h ... monitor_py from the command line.
by joan
Wed Dec 26, 2018 8:25 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 1060

Re: Wirring pi and SPI communication

The following Python works on slave select 1.

Code: Select all

#!/usr/bin/env python

import spidev

conn = spidev.SpiDev(0, 1)
conn.max_speed_hz = 20000
cmd = 0xaa
reply_bytes = conn.xfer([cmd, 0x55])

print(reply_bytes)
spidev is also a wrapper around the Linux SPI routines.
by joan
Wed Dec 26, 2018 6:34 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 1060

Re: Wirring pi and SPI communication

I had a quick look and it does not appear to work.

Perhaps raise an issue with wiringPi?
by joan
Wed Dec 26, 2018 4:44 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 1060

Re: Wirring pi and SPI communication

Have you a complete short example which can be compiled and run and which demonstrates the problem?
by joan
Wed Dec 26, 2018 11:02 am
Forum: Python
Topic: measuring time between two rising edge
Replies: 19
Views: 966

Re: measuring time between two rising edge

There is no evidence that you are using an encoder. The posted code is simply looking at pulses.

Try http://abyz.me.uk/rpi/pigpio/examples.h ... ead_RPM_py
by joan
Wed Dec 26, 2018 10:58 am
Forum: General programming discussion
Topic: Removing pullup/pulldown on a RPi Zero
Replies: 6
Views: 1218

Re: Removing pullup/pulldown on a RPi Zero

That is an internal pull-down of about 50k. It is applied at power-up. You can use a GPIO library to switch the pull off or change it to a pull-up. This setting will be lost over a power cycle and will revert to a pull down. The earliest you will be able to change the pull is by using the gpio direc...
by joan
Tue Dec 25, 2018 11:48 pm
Forum: Troubleshooting
Topic: Can't get an LED to shine
Replies: 3
Views: 92

Re: Can't get an LED to shine

You need a resistor. Without one the LED may burn out in an instant. 5.6K is too big. Perhaps the LED lights but is very dim. You need something in the region 300 to 1000 ohms. How do you know the code is fine? Just because it doesn't report an error (I assume) doesn't mean it is doing anything usef...
by joan
Tue Dec 25, 2018 11:12 pm
Forum: Beginners
Topic: Raspberry Pi 3 & L298N - Motor not turning
Replies: 15
Views: 676

Re: Raspberry Pi 3 & L298N - Motor not turning

You could try the following to see if it's a PWM problem.

sudo pigpiod

pigs w 16 0
pigs w 19 1

pigs p 12 128 # 50% dutycycle PWM

pigs p 12 64 # 25%

pigs p 12 192 # 75%
by joan
Mon Dec 24, 2018 8:53 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 1060

Re: Wirring pi and SPI communication

You want channel 1. That is the term wiringPi uses to indicate chip select 1.
by joan
Mon Dec 24, 2018 8:36 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 1060

Re: Wirring pi and SPI communication

wiringPi only supports the main SPI device so that is not correct. Have you checked the documentation?
by joan
Mon Dec 24, 2018 8:21 pm
Forum: Python
Topic: Difference with callbacks when running as daemon?
Replies: 2
Views: 299

Re: Difference with callbacks when running as daemon?

Can we see a complete example? Snippets don't give enough information.
by joan
Mon Dec 24, 2018 8:16 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 1060

Re: Wirring pi and SPI communication

What does the 0 mean in wiringPiSPISetup?
by joan
Sun Dec 23, 2018 11:14 pm
Forum: Troubleshooting
Topic: GPIO Broken?
Replies: 4
Views: 293

Re: GPIO Broken?

Perhaps you aren't controlling the GPIO you think you are.

A photo of the connections and a listing of the commands you are using to switch the GPIO on/off are needed.

Go to advanced search