Go to advanced search

by joan
Tue Jul 17, 2018 8:13 am
Forum: Beginners
Topic: Problem with using L298n
Replies: 2
Views: 74

Re: Problem with using L298n

I think this is a common problem. Motors are not identical, neither are motor drivers and any gearing being used on the left and right. Neither will the wheels be identical in size. If you use PWM to control the speed you could use a different duty cycle on the left and right sides to compensate for...
by joan
Mon Jul 16, 2018 11:28 am
Forum: Advanced users
Topic: What would the max frequency of a C program be?
Replies: 4
Views: 172

Re: What would the max frequency of a C program be?

Which I/O?
  • SD card
  • USB
  • Ethernet
  • HDMI
  • Serial
  • I2C
  • SPI
  • GPIO
by joan
Mon Jul 16, 2018 7:03 am
Forum: Automation, sensing and robotics
Topic: 16-channel PWM & Servo driver and pi3
Replies: 3
Views: 90

Re: 16-channel PWM & Servo driver and pi3

You don't need the PWM driver on the Pi. pigpio and others can provide suitable servo pulses on all spare GPIO. http://abyz.me.uk/rpi/pigpio/index.html However the module does simplify the wiring and if you want to use it there are several software modules available, e.g. http://abyz.me.uk/rpi/pigpi...
by joan
Mon Jul 16, 2018 6:58 am
Forum: Advanced users
Topic: PWM hardware for dimming LCD
Replies: 3
Views: 145

Re: PWM hardware for dimming LCD

The HW PWM and 3.5 mm audio jack share the same hardware and cannot both operate at the same time. So if the game generates audio on the jack, this is the cause of screen flickering. That sounds the likely problem. I suggest using http://abyz.me.uk/rpi/pigpio/cif.html#gpioPWM rather than gpioHardwa...
by joan
Sun Jul 15, 2018 9:32 pm
Forum: Python
Topic: GPIO Inputs are both High and Low at once
Replies: 3
Views: 113

Re: GPIO Inputs are both High and Low at once

I suggest you print the value of r and c in the tmp == 1 and the tmp == 0 blocks. That will indicate that it is not the same time frame. As a matter of style I would use else rather than elif tmp == 0.
by joan
Sun Jul 15, 2018 9:14 pm
Forum: Android
Topic: android app for raspberry pi
Replies: 8
Views: 220

Re: android app for raspberry pi

The pigpio Python module should run under Android (at least it does on my Android phone with QPython3). http://abyz.me.uk/rpi/pigpio/python.html It does for me too under Pydroid3 iirc. As does gpiozero to make it easier for the beginner. I downloaded QPython3 from Google Play and ran the following ...
by joan
Sun Jul 15, 2018 8:49 pm
Forum: Android
Topic: android app for raspberry pi
Replies: 8
Views: 220

Re: android app for raspberry pi

The pigpio Python module should run under Android (at least it does on my Android phone with QPython3).

http://abyz.me.uk/rpi/pigpio/python.html
by joan
Fri Jul 13, 2018 3:38 pm
Forum: General discussion
Topic: Confusing about the hardware and I2C connection on raspberry pi 3
Replies: 4
Views: 153

Re: Confusing about the hardware and I2C connection on raspberry pi 3

You should not expose the Pi GPIO to more than 3.3V. If your I2C device works with 3V3 it should be safe to use as it is unlikely to set SDA to more than 3.3V. If your I2C device needs 5V you need to check to see if it is safe. If the I2C device does not have its own pull-ups installed it will proba...
by joan
Thu Jul 12, 2018 3:36 pm
Forum: Advanced users
Topic: Testing GPIO pins
Replies: 3
Views: 167

Re: Testing GPIO pins

Possibly.

Remove all connections from the expansion header and run wiringPi's pintest utility or pigpio's gpiotest utility.

For gpiotest see https://elinux.org/R-Pi_Troubleshooting#Testing
by joan
Thu Jul 12, 2018 6:44 am
Forum: Beginners
Topic: Controlling initial state of GPIO
Replies: 2
Views: 108

Re: Controlling initial state of GPIO

Look at the gpio directive used within the /boot/config.txt file.

Note that this directive is not the same as wiringPi's gpio command.
by joan
Wed Jul 11, 2018 9:05 am
Forum: Beginners
Topic: How to use PMW without using the “gpio” programm?
Replies: 6
Views: 157

Re: How to use PMW without using the “gpio” programm?

So I can just use 2 pins at once because there are just two channels? Channel 0 and channel 1 are independent and can have distinct frequency and duty cycle settings. Channel 0 can be routed to GPIO 12 and/or 18. Channel 1 can be routed to GPIO 13 and/or 19. This assumes that the config.txt softwar...
by joan
Wed Jul 11, 2018 6:43 am
Forum: Python
Topic: GPIO callback function does not update quick enough
Replies: 4
Views: 145

Re: GPIO callback function does not update quick enough

RPi.GPIO is the obvious choice. It will be as fast as any of the others for callback responsiveness. If that is not good enough you will probably have to use C.
by joan
Tue Jul 10, 2018 6:00 pm
Forum: Python
Topic: GPIO callback function does not update quick enough
Replies: 4
Views: 145

Re: GPIO callback function does not update quick enough

pigpio Python may not be suitable. Callbacks will have perhaps 0.5 milliseconds latency. You would be better off using another Python GPIO library if you want an immediate response to an interrupt.
by joan
Tue Jul 10, 2018 10:32 am
Forum: Beginners
Topic: How to use PMW without using the “gpio” programm?
Replies: 6
Views: 157

Re: How to use PMW without using the “gpio” programm?

There are two channels of hardware PWM (GPIO 12/18, 13/19) which can be used for PWM as indicated by pcmanbob.

If you mean bit banging PWM by writing using sysfs from a shell then it is likely to be jittery and low frequency.
by joan
Tue Jul 10, 2018 10:26 am
Forum: Troubleshooting
Topic: Problem with GPIO pins
Replies: 28
Views: 554

Re: Problem with GPIO pins

That indicates a permanent failure (assuming nothing was connected to the failing GPIO during the test). The likely cause is connecting more than 3.3V to one of those GPIO.
by joan
Mon Jul 09, 2018 5:42 pm
Forum: C/C++
Topic: Problem writing to /dev/tty
Replies: 4
Views: 164

Re: Problem writing to /dev/tty

Output is buffered until a newline is seen.
by joan
Mon Jul 09, 2018 3:13 pm
Forum: Troubleshooting
Topic: Problem with GPIO pins
Replies: 28
Views: 554

Re: Problem with GPIO pins

Run wiringPi's pintest or pigpio's gpiotest with nothing connected to the GPIO.

https://elinux.org/R-Pi_Troubleshooting#Testing
by joan
Mon Jul 09, 2018 11:34 am
Forum: Advanced users
Topic: Is there a performance penalty to using two byte structs instead of 4?
Replies: 16
Views: 471

Re: Is there a performance penalty to using two byte structs instead of 4?

Rather than ask why don't you just find out?

Time the alternatives and use the fastest if that is important to you.
by joan
Mon Jul 09, 2018 10:03 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Synchronous 3-wire serial interface
Replies: 3
Views: 121

Re: Synchronous 3-wire serial interface

Which device? If it needs MISO and MOSI on a single line (because it receives variable commands and returns a value) then you will need 3-wire mode.
by joan
Mon Jul 09, 2018 9:11 am
Forum: Troubleshooting
Topic: wiringPiI2CWriteReg16 function for 16 bit register addressing
Replies: 1
Views: 28

Re: wiringPiI2CWriteReg16 function for 16 bit register addressing

I2C transmits data in units of 8-bit bytes - always has, always will. Clearly you will need to send more than one 8-bit byte to select a 13 bit address. You need to look at the datasheet for the device.
by joan
Mon Jul 09, 2018 7:11 am
Forum: Troubleshooting
Topic: Power through 5v GPIO
Replies: 3
Views: 100

Re: Power through 5v GPIO

All the Pi GPIO are 3V3. If you feed 5V into a Pi GPIO you are likely to destroy the GPIO and the Pi.

You can power by supplying 5V to a 5V pin on the expansion header (i.e. supply power to the 5V rail and ground).
by joan
Sun Jul 08, 2018 8:53 pm
Forum: C/C++
Topic: Mutex format for C++
Replies: 9
Views: 260

Re: Mutex format for C++

Raspbian is one of many Linux/GNU distributions. It doesn't make sense to look for Raspbian documentation for C++ or mutexes. Look for Linux mutexes.
by joan
Sat Jul 07, 2018 3:11 pm
Forum: Beginners
Topic: import RPIO is not working
Replies: 7
Views: 118

Re: import RPIO is not working

gordon77 wrote:
Sat Jul 07, 2018 2:32 pm
import RPi.GPIO as GPIO
RPIO has additional features - RPi.GPIO is not a replacement.
by joan
Sat Jul 07, 2018 2:36 pm
Forum: Beginners
Topic: Controlling Servo with Python
Replies: 7
Views: 138

Re: Controlling Servo with Python

I suggest you print out the angle and pulse width you are trying to send (servos are controlled by the pulse width not by duty cycle, so you will need to translate the duty cycle you are using into a pulse width in microseconds).

Go to advanced search