Go to advanced search

by joan
Sat Dec 28, 2019 6:22 pm
Forum: Other programming languages
Topic: Two servos in perl example.
Replies: 9
Views: 1018

Re: Two servos in perl example.

As you say there are two hardware PWM channels. You will have to use software PWM for any additional ESCs. Unless there is a RPIO module for PERL (n.b. RPIO, not RPi.GPIO).
by joan
Fri Dec 27, 2019 9:21 pm
Forum: Python
Topic: Making my servo move in increments/decrements of 1 degree
Replies: 10
Views: 719

Re: Making my servo move in increments/decrements of 1 degree

That appears to be a standard servo, not continuous rotation. You can quite easily check using pigpio. Start the daemon. sudo pigpiod Assuming you are using GPIO 4 (Broadcom numbering). Command the servo to -67.5 pigs s 4 1000 Command the servo to 0 pigs s 4 1500 Command the servo to +67.5 pigs s 4 ...
by joan
Fri Dec 27, 2019 5:24 pm
Forum: Python
Topic: Making my servo move in increments/decrements of 1 degree
Replies: 10
Views: 719

Re: Making my servo move in increments/decrements of 1 degree

You can't use a continuous rotation servo to do what you want without additional hardware.

Could you link to the specs of your servos?
by joan
Fri Dec 27, 2019 4:07 pm
Forum: Automation, sensing and robotics
Topic: Limit switches and GPIO
Replies: 6
Views: 633

Re: Limit switches and GPIO

It's probably not sensible to connect two GPIO both set as outputs. If they have different levels that will be a short-circuit which will probably damage the GPIO and eventually the Pi.
by joan
Fri Dec 27, 2019 3:48 pm
Forum: Python
Topic: Making my servo move in increments/decrements of 1 degree
Replies: 10
Views: 719

Re: Making my servo move in increments/decrements of 1 degree

The servo angle depends on the pulse width. A pulse width of 1500 µs will be central. Generally increasing the pulse width by 10 µs will increase the angle by 1 degree, decreasing the pulse width by 10 µs will decrease the angle by 1 degree. Just adjust the software you are using to do the same. n.b...
by joan
Fri Dec 27, 2019 9:40 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: [HELP] [I2C] Pressure Sensor Code Problem
Replies: 4
Views: 477

Re: [HELP] [I2C] Pressure Sensor Code Problem

pressureValue = rawValue[1] << 16 | rawValue[1] << 8 | rawValue[1]

Is not right.

In effect if you read x you are setting the answer to 65536*x + 256*x + x

You should be fetching the low, middle, high byte as the Arduino code is doing.
by joan
Thu Dec 26, 2019 6:09 pm
Forum: C/C++
Topic: GTK and pigpio.h level change callback
Replies: 6
Views: 583

Re: GTK and pigpio.h level change callback

piscope is a C GTK application which uses pigpio and the GPIO.

Code at http://abyz.me.uk/rpi/pigpio/piscope.html or https://github.com/joan2937/piscope
by joan
Thu Dec 26, 2019 5:59 pm
Forum: Troubleshooting
Topic: Trouble getting RF transmitter working
Replies: 1
Views: 163

Re: Trouble getting RF transmitter working

It's fine to power the transmitter from 5V. It's best to power the receiver from 3V3 or use a resistor divider (between the receiver output and the GPIO) if powering from 5V. Try http://abyz.me.uk/rpi/pigpio/examples.html#Python__433_py on the input (and/or the output). It will set a glitch filter o...
by joan
Thu Dec 26, 2019 10:34 am
Forum: Bare metal, Assembly language
Topic: GPIO mode switch latency
Replies: 3
Views: 708

Re: GPIO mode switch latency

The mode change will take say a microsecond (probably less, I haven't tested). The GPIO level will change more slowly as the voltage at the GPIO changes. It takes time for the current to leak away. I'd have thought microseconds rather than milliseconds though. I expect there is more capacitance in y...
by joan
Wed Dec 25, 2019 7:56 am
Forum: Python
Topic: How to read/write the register of a device on a i2c bus
Replies: 3
Views: 367

Re: How to read/write the register of a device on a i2c bus

You have to write 8 bits. If the top 4 bits are significant (unlikely, read the device specs) you will need to read the register before hand to find the value of those bits and then include those bits in the ones you subsequently write to the register. Look up Python bit handling.
by joan
Mon Dec 23, 2019 10:51 am
Forum: General discussion
Topic: Inconsistencies in .csv RPM logger
Replies: 2
Views: 153

Re: Inconsistencies in .csv RPM logger

I would log the data received and try to work out why the software does not work for those low values. Then you will be able to decide how the software needs to be changed (if it does).
by joan
Sun Dec 22, 2019 10:07 pm
Forum: General discussion
Topic: Not able to read in HIGH Pin [solved]
Replies: 6
Views: 319

Re: Not able to read in HIGH Pin

Test the GPIO with wiringPi's pintest or (my) pigpio's gpiotest.
by joan
Sat Dec 21, 2019 9:08 pm
Forum: C/C++
Topic: PCF8574 pwm (wiringPi? pigpio?)
Replies: 11
Views: 1033

Re: PCF8574 pwm (wiringPi? pigpio?)

If you want jitter free over I2C perhaps a module based on the PCA9685? It's commonly used for servos but it can be used to generate 500Hz+.
by joan
Sat Dec 21, 2019 5:29 pm
Forum: Python
Topic: Can I use PWM pins on raspberry pi 4 as reading pins?
Replies: 1
Views: 214

Re: Can I use PWM pins on raspberry pi 4 as reading pins?

The PWM support from the hardware is output only. If you want to read PWM on any of the GPIO it will have to be done in software.
by joan
Sat Dec 21, 2019 3:58 pm
Forum: C/C++
Topic: PCF8574 pwm (wiringPi? pigpio?)
Replies: 11
Views: 1033

Re: PCF8574 pwm (wiringPi? pigpio?)

Yes it is. However toggling a pin by writing to a device on the I2C bus will be subject to a lot of jitter.
by joan
Fri Dec 20, 2019 5:18 pm
Forum: Beginners
Topic: External Power Supply for Servos
Replies: 12
Views: 521

Re: External Power Supply for Servos

https://drive.google.com/file/d/1pk0iEY ... sp=sharing

The photo is not clear enough to follow the wiring.
by joan
Fri Dec 20, 2019 5:10 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Both devices need to use SDA and SCL
Replies: 2
Views: 315

Re: Both devices need to use SDA and SCL

I2C is a bus. Multiple devices may be connected in parallel.
by joan
Fri Dec 20, 2019 12:03 pm
Forum: Automation, sensing and robotics
Topic: reading results from up to 50 sensors
Replies: 5
Views: 714

Re: reading results from up to 50 sensors

There will be plenty of code example if you google raspberry pi and mcp3008 software. The MCP3008 is a 10-bit resolution ADC (Analogue to Digital converter). It compares the voltage reference (generally 3V3 if used with the Pi) against the voltage at an input pin and returns a value between 0 and 10...
by joan
Thu Dec 19, 2019 11:02 pm
Forum: Automation, sensing and robotics
Topic: reading results from up to 50 sensors
Replies: 5
Views: 714

Re: reading results from up to 50 sensors

You can use multiple MCP3008, 4 is certainly possible. Each is connected in parallel to the SPI bus and each will have a dedicated GPIO for chip select. So you need four GPIO plus the three GPIO of the SPI bus (MOSI, MISO, SCLK).
by joan
Thu Dec 19, 2019 6:43 pm
Forum: Beginners
Topic: External Power Supply for Servos
Replies: 12
Views: 521

Re: External Power Supply for Servos

Why ask us to guess? Show us a wiring diagram and clear photos of the connections plus the software listing you actually used.
by joan
Tue Dec 17, 2019 5:59 pm
Forum: Beginners
Topic: Unpowering servo to stop jitter
Replies: 7
Views: 326

Re: Unpowering servo to stop jitter

This probably won't help you but I have a PCA9685 driver which allows for the pulses to be stopped (pulse width of 0).

http://abyz.me.uk/rpi/pigpio/examples.h ... PCA9685_py
by joan
Tue Dec 17, 2019 9:28 am
Forum: Beginners
Topic: Help With PWMOutputDevice
Replies: 2
Views: 217

Re: Help With PWMOutputDevice

What is that code meant to do?

What device are you trying to control? Do you know what signal to send to that device to achieve that control?
by joan
Mon Dec 16, 2019 10:35 pm
Forum: C/C++
Topic: How to drive max7219 8digit 7segment tube via pigpio spi?
Replies: 9
Views: 991

Re: How to drive max7219 8digit 7segment tube via pigpio spi?

Have you updated wiringPi? There was a new version available from wiringpi.com for the Pi4B.
by joan
Mon Dec 16, 2019 2:13 pm
Forum: Troubleshooting
Topic: I2C device detected with i2cdetect, however I still get "No I2C device at address" error.
Replies: 17
Views: 1661

Re: I2C device detected with i2cdetect, however I still get "No I2C device at address" error.

Can we have a photo of the connections between the Pi and the devices?

I'd also try to sniff the traffic with

http://abyz.me.uk/rpi/pigpio/examples.h ... 2C_sniffer

All you need is I2C_sniffer.py

Change I2C_sniffer.sniffer(pi, 1, 0, False) to I2C_sniffer.sniffer(pi, 3, 2, False)
by joan
Mon Dec 16, 2019 7:29 am
Forum: Troubleshooting
Topic: How can I verify that GPCLK0 is running on my Pi?
Replies: 1
Views: 175

Re: How can I verify that GPCLK0 is running on my Pi?

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

http://abyz.me.uk/rpi/pigpio/examples.h ... monitor_py

To get accurate data the clock should be 100 kHz or less. However any frequency should show up.

Go to advanced search