Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / controlling motors with DB?

Author
Message
dontaskme
20
Years of Service
User Offline
Joined: 20th Jan 2004
Location: CH
Posted: 8th Dec 2019 11:38
I have no idea how to do this:
Can I have any kind of interaction between DB and motors?
Say I wanted to implement a writing/drawing machine, controlled with DB: Is it possible?
If yes, where to start? What elements/interfaces would I need? Has somebody done it?
Any input on the topic is most welcomed
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 4th Jan 2020 05:08
i built a 3d printer long ago using dbpro. but dbpro itself cannot control motors i used it for generating slices of a model and generating 3d coordinates then running them through a gcode grble controller then to the stepper ic board and finally magic. agk however can control serial i/o

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 7th Jan 2020 01:15
Hi dontaskme:

The short answer in regards to sending a signal to a motor is yes. Any program that can access the various input output ports on a computer can in theory control motors. You would have to figure out the voltage etc. so you don't damage your computer. Going back, and this will date me, people used the commodore 64's joystick ports to control all kinds of things. Also the serial out to the disk drive was used for just those sort of things - after all, the disk drive ran on a motor.

if you were to hook up a mechanical disk drive, hard drive, etc to the USB port of your computer, you are in essence controlling that motor. With the correct commands sent you could in theory control the speed and direction of that motor. What I'm talking about are all kinds of hacks. There isn't outright a means to control a motor but you could do it using DBPros basic language. Think of rumble packs in a joystick/controller. There are commands in DBPro for the intensity of the rumble I believe. Replace the motor in the joystick with one that has wheels or whatever.
Enjoy your day.
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 21st Feb 2020 01:51
Hi dontaskme, sorry for late response but I just got here. I hope the DBP party still has a long time to go.

Years ago I came up with a way of controlling motors and other things on my C64 because I needed more than 8 outputs.
It's very simple really.

Step 1. Place a lot of white squares in a grid pattern along the bottom of the screen.

Step 2. Make a small circuit that you can find online called DIY LIGHT ACTIVATED SWITCH. I'll upload a pic of what I was doing and I hope it helps.

It's easier to put the circuits on one board and the LDR's (light dependent resistors) on a separate board that can be taped to the bottom of a computer screen.

Basically, switch a white square on and the LDR that lines up with the square will allow power through the transistor to turn something on.
I could even vary the speed of a motor by varying the brightness of the square. I did notice that the transistor ran hotter when only partially on and ran cool when fully on.

Cheers.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-03-28 15:04:22
Your offset time is: 2024-03-28 15:04:22