I wanted to know if anyone knows if I can use a transistor as an on/off switch that is controlled by a GPIO pin? I am sorry that I have to right this but this needs to be the right length so that I can post it.
Yes
Like below (not the only way).
GPIO high = switch on
GPIO low = switch off
Related
I connected the PCM1860 ADC in this manner. I expect data on my oscilloscope on the digital output (pin 18). I have so far only seen square wave on the clock pins but nothing on the data pin. Is this connected ok?
If i want to use mpu6050 intterrupt to wake up stm32.
when i move my board,stm32 can wake up form stop mode.
i have realized the iic communication between stm32 and mpu6050.and stm32 can already enter stop mode.
What I am trying to do is:
Programatically I want to switch on and off the USB power of the RPi B3+ or 4 models.
I know that I can put 0 in /sys/devices/platform/soc/3f980000.usb/buspower but seems like it does not work as expected.
Let me show you what all things I have tried:
Check 1:
Connect USB device (In my case, its camera) to the Rpi
Fire command "lsusb" In the list,
I get my camera listed properly
Check 2:
The camera is connected and lsusb is showing the device
sudo vi /sys/devices/platform/soc/3f980000.usb/buspower and put 0 in it and save the file
again lsusb
All the connected devices list is gone. Looks like its working
BUT:
When I put voltage meeter on the usb port(As showin in screenshot) , it shows same current flowing through the USB ports.
Refer attached screenshot below to understand this issue.
Looking for the solution if anyone knows.
I have a Raspberry PI2 with Adafruit MotorHAT, and two stepper motors attached to the hat. I have installed the Cymplecy GPIO7 on my Raspberry Pi 2, and I tried to control the stepper motors with it, but I cannot. I set the AddOn variable to MotorHAT, and send broadcast message "motor1speed20" but nothing happens.
Does anybody know anything about how to control stepper motors using scratch in such an environment like this? Does GPIO addon supports this adafruit motorhat?
I am trying to use the RPI 3's hardware PWM pin.
Is there a simple Bash script or C program that activates and controls the PWM pin?
WiringPi has written a GPIO utility for testing against the Raspberry GPIO pins. It includes PWM functionallity. Check it out on http://wiringpi.com/the-gpio-utility/