Go to advanced search

by OutoftheBOTS
Sat Feb 16, 2019 12:01 pm
Forum: Automation, sensing and robotics
Topic: Fuse between motor driver board and power source?
Replies: 12
Views: 201

Re: Fuse between motor driver board and power source?

Thanks for the replies. Yes, I use non-rechargable batteries indeed. Why is it that rechargable batteries provide more current or in other words why do they have a lower internal resistance? Then this would also mean that I should rather use a 20A fuse when I use rechargable batteries and the 5A fu...
by OutoftheBOTS
Fri Feb 15, 2019 9:36 pm
Forum: Automation, sensing and robotics
Topic: Fuse between motor driver board and power source?
Replies: 12
Views: 201

Re: Fuse between motor driver board and power source?

A fuse is basically a weak point. When something shorts out then current can flow very high and what ever can handle the lowest current will burnout first. So to protect the rest of your components you will add a fuse(weak point) so if there is a short and current goes high the fuse burnouts rather ...
by OutoftheBOTS
Fri Feb 15, 2019 9:16 pm
Forum: Python
Topic: Receiving printer data from PC using serial-to-TTY
Replies: 4
Views: 84

Re: Receiving printer data from PC using serial-to-TTY

Normally when you get a heap of weird chars like that it means the configuration n is wrong (most common the baud rate). Your post you show the setup on windows and the setup on RPi and they match but I suspect that maybe windows changes the baud rate when printing??? especially since your only send...
by OutoftheBOTS
Mon Feb 04, 2019 10:58 am
Forum: Automation, sensing and robotics
Topic: Seeking guidance with powering motors
Replies: 19
Views: 471

Re: Seeking guidance with powering motors

U can get these dual h-bridge very cheap that will drive larger motors https://www.aliexpress.com/item/Special-promotions-2pcs-lot-L298N-motor-driver-board-module-L298-for-arduino-stepper-motor-smart-car/32224772756.html?ws_ab_test=searchweb0_0,searchweb201602_4_10065_10068_10130_10547_319_317_10548...
by OutoftheBOTS
Sat Feb 02, 2019 7:37 am
Forum: Python
Topic: Need to Zero array in PyUSB
Replies: 2
Views: 143

Re: Need to Zero array in PyUSB

I assume that your using a call back when a mouse event occurs. If so what I would do is have a global variable that holds a time stamp that is updated every-time the call back occurs then in your main loop compare the time stamp to current time and if the needed time has passed then zero the array :)
by OutoftheBOTS
Sat Jan 26, 2019 9:40 pm
Forum: Python
Topic: encoder with python
Replies: 1
Views: 129

Re: encoder with python

OK this is a long story and I will see if I can answer it as short and simple as possible with giving you enough info. For useful motor control you need to build up layers of behavior with each layer building on the top of the lower layer. First layer speed control: You make a function that controls...
by OutoftheBOTS
Fri Jan 25, 2019 8:50 am
Forum: Python
Topic: Paralell?
Replies: 4
Views: 199

Re: Paralell?

It can be easily achieved like this The problem with that code is that unless you do use a callback or something like that, if the button is pressed while the sensor is being read, it won't be detected. The DS18B20 can take a second or so to read. I had no idea that reading that temp sensor was so ...
by OutoftheBOTS
Fri Jan 25, 2019 8:34 am
Forum: Python
Topic: Using one button to cycle thru 3 scenarios
Replies: 6
Views: 215

Re: Using one button to cycle thru 3 scenarios

global btnclick btnclick = 0 def do_cycle(): global btnclick if btnclick == 0: labeloffo.configure(image=picred) labeloffo.image=picred btnclick = btnclick + 1 elif btnclick == 1: labeloffc.configure(image=picgrn) labeloffc.image=picgrn btnclick = btnclick + 1 elif btnclick == 2: labeloffo.configur...
by OutoftheBOTS
Thu Jan 24, 2019 10:48 pm
Forum: Python
Topic: Using one button to cycle thru 3 scenarios
Replies: 6
Views: 215

Re: Using one button to cycle thru 3 scenarios

to elaborate a little more. When a function is called it will create/allocate any variables that are used within the function that are not declared global then when the function returns it will destroy/de-allocate all variables that are not global. So every time you call your function it creates a n...
by OutoftheBOTS
Thu Jan 24, 2019 10:41 pm
Forum: Python
Topic: Paralell?
Replies: 4
Views: 199

Re: Paralell?

I generally wouldm't use call back threading for such a simple task. It can be easily achieved like this import time #add code to setup the pin for button pressed start_time = time.now() While True: #if 10 seconds has passed then read sensor if time.now() - start_time > 10: #code to read sensor goes...
by OutoftheBOTS
Wed Jan 16, 2019 8:24 am
Forum: Python
Topic: Read Multiple Lines of Data At Once
Replies: 2
Views: 478

Re: Read Multiple Lines of Data At Once

Ok I haven't used the MCP3008 ADC but do know of it. I mainly use the ADS1115 or the ADC pins of a MCU. Now your trying to do this in a very usual way. Your code to read the sensors sets up the SPI and then reads the data then turns the data into a string. The data being returned is an integer why t...
by OutoftheBOTS
Wed Jan 09, 2019 6:52 am
Forum: Python
Topic: Using button to activate servo not working, it just make a wierd sound...
Replies: 2
Views: 136

Re: Using button to activate servo not working, it just make a wierd sound...

Well your code looks fine.

When your switch pin gets connected to ground then it should enter the loop that moves the servo.

Please check your wiring that the switch is pulling the pin to ground when pressed.
by OutoftheBOTS
Thu Jan 03, 2019 4:50 am
Forum: Python
Topic: 256 colors mode.
Replies: 13
Views: 426

Re: 256 colors mode.

Well then you have a few options. Just write it in block of 4096 this shouldn't slow you down too much as it is still large blocks not individual pixels. I do believe it maybe possible to change the max size of SPI buffer but not sure on exact linux kernal settings. After a bit of googling it seems ...
by OutoftheBOTS
Wed Jan 02, 2019 8:11 pm
Forum: Python
Topic: 256 colors mode.
Replies: 13
Views: 426

Re: 256 colors mode.

So what happens is python is slow to call a function. So calling the function to write to the SPI takes much longer than the writing. So make a buffer and write the whole screen in 1 write rather than call it over and over in a for loop. Something like this #create a buffer to hold a 16bit image of ...
by OutoftheBOTS
Tue Jan 01, 2019 10:43 am
Forum: Automation, sensing and robotics
Topic: DRV 8825 Potentiometer not changing voltage
Replies: 3
Views: 170

Re: DRV 8825 Potentiometer not changing voltage

You won't be able to adjust the amp pot unless you have the RPi/MCU pulling the rest and sleep pins high. Make sure u have it wired up like following
0J4232.600.png
0J4232.600.png (77.16 KiB) Viewed 160 times
The voltage needs to half the desired amps
by OutoftheBOTS
Tue Jan 01, 2019 10:34 am
Forum: Python
Topic: 256 colors mode.
Replies: 13
Views: 426

Re: 256 colors mode.

I written my own drivers for these little screen before and once once u run initialization code then set the window you want to write too you can just send the RAMWR (ram write) command then send the image buffer to the SPI then it will appear on the screen. here is a good example of a driver I wrot...
by OutoftheBOTS
Tue Jan 01, 2019 8:07 am
Forum: Python
Topic: 256 colors mode.
Replies: 13
Views: 426

Re: 256 colors mode.

Can you please post a link to the screen that your using. I use all sorts of little SPI screens all the time for a number of different project and drive then with lots of different processor from RPi to STM32 to ESP32 and you should have any sort of problem with getting high enough frame rares on su...
by OutoftheBOTS
Mon Dec 31, 2018 9:05 pm
Forum: Python
Topic: 256 colors mode.
Replies: 13
Views: 426

Re: 256 colors mode.

I am a little confused upon the what colour modes u r starting from and what colour modes your converting to. Most of these little SPI screens can be run in either 16bit colour(recommended) or 18bit colour(a pain in the butt) 16bit colour RGB565 (5 bits of red, 6 bits of green and 5 bits of blue) th...
by OutoftheBOTS
Wed Dec 26, 2018 9:52 am
Forum: Python
Topic: Pass variable script problem
Replies: 3
Views: 217

Re: Pass variable script problem

well when u import script1 then it imports script2 so it runs twice. Just simple remove import script2 from script1
by OutoftheBOTS
Thu Dec 20, 2018 7:46 am
Forum: Automation, sensing and robotics
Topic: Need help in converting Arduino coding to Python for RPi
Replies: 5
Views: 1570

Re: Need help in converting Arduino coding to Python for RPi

My code can also be used with interrupts (this is how the ardunio guys usually do it on which I based my code on) If you are trying to read encoders with 2000 counts/revolution and it is spins at any sort of speed the counts will come faster than the RPi can count and it will miss counts. The RPi ru...
by OutoftheBOTS
Wed Dec 19, 2018 11:16 am
Forum: Automation, sensing and robotics
Topic: Need help in converting Arduino coding to Python for RPi
Replies: 5
Views: 1570

Re: Need help in converting Arduino coding to Python for RPi

The ardunio code you posted isn't the normal code used by most ardunio uses fro encoder counter. Here's video I made explaining how to read a encoder https://www.youtube.com/watch?v=p4BCFhIuC88&t=191s at about 8mins you will see the python code that runs on the RPi to count the encoders but earlier ...
by OutoftheBOTS
Tue Dec 18, 2018 8:42 pm
Forum: Automation, sensing and robotics
Topic: Connecting a 2.4GHz receiver to a Pi
Replies: 8
Views: 1807

Re: Connecting a 2.4GHz receiver to a Pi

OK there is a number of protocols (standards for speaking between 2 chips) for serial communication where UART (Universal Asynchronous Receiver/Transmitter.) is 1 type. In this UART protocol many things can be configured like speed of communication, half duplex/full duplex and a number of other thin...
by OutoftheBOTS
Sun Dec 16, 2018 10:09 pm
Forum: Automation, sensing and robotics
Topic: Connecting a 2.4GHz receiver to a Pi
Replies: 8
Views: 1807

Re: Connecting a 2.4GHz receiver to a Pi

The RPi has separate RX(receive) and TX(transmit) pins (this is normal), this is known as full duplex UART but the I-bus protocol uses half duplex UART where the receive and transmit is done on the same pin (i-bus pin). I am not sure myself why they have been putting a diode and resistor between the...
by OutoftheBOTS
Sat Dec 15, 2018 11:43 pm
Forum: Automation, sensing and robotics
Topic: Connecting a 2.4GHz receiver to a Pi
Replies: 8
Views: 1807

Re: Connecting a 2.4GHz receiver to a Pi

I am currently researching doing something similar, using the next generation transmitter https://www.aliexpress.com/item/Original-Flysky-FS-i6X-10CH-2-4GHz-AFHDS-2A-RC-Transmitter-FS-iA6B-FS-iA10B-FS/32850165315.html with either the X6B receiver or more likely the Flit 10 reciever see https://www.a...
by OutoftheBOTS
Fri Dec 14, 2018 9:02 pm
Forum: Automation, sensing and robotics
Topic: Rotary Encoder Count per Revolution missing some count
Replies: 14
Views: 706

Re: Rotary Encoder Count per Revolution missing some count

First the video linked does describe in details how that method works to count encoders. Second as for binary operations here is a good tutorial on using them in python https://www.tutorialspoint.com/python/bitwise_operators_example.htm Third if you want to find a solution to your problem you first ...

Go to advanced search