MX1508 motor driver and CD reader defective.

Place your projects here
Post Reply
User avatar
Fernando Perez
Posts: 118
Joined: Mon Feb 15, 2021 10:09 pm
Location: Santander (Spain)
Has thanked: 62 times
Been thanked: 70 times

MX1508 motor driver and CD reader defective.

Post by Fernando Perez »

Code: [Local Link Removed for Guests]

' Wemos D1 mini
' Motor control module MX1508
' Mechanism of old damaged CD player
' GPIO12 (D6) = switch open
' GPIO13 (D7) = switch close
' GPIO4 (D2) = A2 of MX1508 = - Motor
' GPIO5 (D1) = A1 of MX1508 = + Motor

pin.mode 12,INPUT 
pin.mode 13,INPUT 

pin.mode 4,OUTPUT 
pin.mode 5,OUTPUT 

pin(4) = 0
pin(5) = 0

' if the door is not fully open or fully closed
if pin(12) = 1 AND pin(13) = 1 then close

onHtmlReload loadHTML
gosub loadHTML

cssExternal "style.css"

a$ = "<center>"
a$ = a$ + |<div id="T1"><p>Restricted access area</p></div>|
a$ = a$ + |<div id="T2"><p>Authorized personal only</p></div>|

if pin(12) = 1 then a$ = a$ + button$("OPEN", open, "btn")
if pin(13) = 1 then a$ = a$ + button$("CLOSE", close, "btn")
a$ = a$ + "</center>"
html a$

  pin(5) = 1
  loop until pin(12) = 0
  pin(5) = 0
  gosub loadHTML

  pin(4) = 1
  loop until pin(13) = 0
  pin(4) = 0
  gosub loadHTML

[External Link Removed for Guests]

I did this little project to learn about motor control with limit switches and take advantage of the mechanism of a broken CD player.
He also managed to entertain my grandson by using it as a liftgate for his construction toy. Only 15 minutes, but you know ... this generation!
[External Link Removed for Guests]
You do not have the required permissions to view the files attached to this post.
Post Reply