0

Something simple Im missing...
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

Something simple Im missing...

by Hardball1911 on Fri Aug 31, 2018 9:20 am

Guys,

I am new to Python, but not to coding, so I know I'm missing something stupid simple.

I am using the 16 channel HAT, and can get servos to operate properly using a tkinter button press, but I am also trying to add a step_speed to the mix.

I am using servos to control a model train layout. I have, through a search, found a script written that is similar to simpletest.py that includes step-speed, but I'm stuck in Python trying to get the function to operate as I want to. Any advice you have would be appreciated. I'm old, I'm learning a new language, and I'm tired...

Thanks in advance!

Hardball1911
 
Posts: 6
Joined: Fri Aug 31, 2018 9:14 am

Re: Something simple Im missing...

by adafruit_support_mike on Sat Sep 01, 2018 12:49 am

Post the code you're using now between CODE tags and we'll take a look.

Also, what's the last thing the code does correctly before the first thing that goes wrong?

adafruit_support_mike
 
Posts: 55974
Joined: Thu Feb 11, 2010 2:51 pm

Re: Something simple Im missing...

by Hardball1911 on Mon Sep 10, 2018 2:50 pm

Mike,

Basically my code is straight forward. A snippet is included, but it is the basic movement.

I have seen some code out there that works similar to what I want, however I want to control this with tkinter buttons... that code is from semucon on raspberrypi.org forums... that code is

Code: Select all | TOGGLE FULL SIZE
# Demo of using RPi Adafruit PWM hat for servo control using SG90 servo
# Need to be careful with min and max pulse width values otherwise SG90
# goes crazy

from __future__ import division
from time import sleep
#import RPi.GPIO as GPIO
import Adafruit_PCA9685

# Uncomment to enable debug output.
#import logging
#logging.basicConfig(level=logging.DEBUG)

# Initialise the PCA9685 using the default address (0x40).
pwm = Adafruit_PCA9685.PCA9685()

# Alternatively specify a different address and/or bus:
#pwm = Adafruit_PCA9685.PCA9685(address=0x41, busnum=2)

# Configure static values for PWM hat
resolution = 4096 # 12 bit resolution
frequency = 50 # pwm frequency in Hz
channel = 0 # using first of 16 channels
channel1 = 1

# Configure min, centre and max servo pulse lengths for SG90
# "Official" values are 1000, 1500 and 2000 microseconds but these only appear to give
# around 90 degrees of travel
servo_min = 800
servo_max = 2400
servo_center = int((servo_min+servo_max)/2)
step_speed =1####change to make servos move faster or slower...

# This helper function sets servo position from pulse length in microseconds
def set_servo(channel, pulse_length):
   
    #pwm.set_pwm(channel,0,int(pulse_length*frequency*resolution/1000000))
    pwm.set_pwm(channel1,0,int(pulse_length*frequency*resolution/1000000))
    #pwm.set_pwm(channel15,0,int(pulse_length*frequency*resolution/1000000))

try:

    pwm.set_pwm_freq(frequency)
    #set_servo(channel, servo_center)
    set_servo(channel1, servo_center)
    #set_servo(channel15, servo_center)

    while True:

        # move from central to max
        print('Moving servo from centre to max {0}'.format( servo_max))
        for i in range (servo_center, servo_max, step_speed):
            #print(i)
            set_servo(channel,i)

        sleep(.5)
       
       
       
        # Move from max to min
        print('Moving servo from max {0} to min {1}'.format(servo_max, servo_min))
        for i in range (servo_max, servo_min, step_speed * -1):
            #print(i)
            set_servo(channel,i)
   
        sleep(.5)

        # move from min back to centre   
        print('Moving servo from min {0} to centre'.format(servo_min))
        for i in range (servo_min, servo_center, step_speed):
            set_servo(channel,i)
   
        sleep(.5)

except KeyboardInterrupt:
    print ("\nKeyboard Interrupt!\n")

finally:
    set_servo(channel, servo_center)
 
    pwm = None
    #GPIO.cleanup()


My code is the basic servo_min = 800, servo_max = 2400, etc. which works with buttons, but at full speed of servo movement from one position to the other. So, in playing with the above code, I can get it to work only in one direction stepping through the servo_min to servo_center, etc, but it sticks there... I think I used an if statement similar to if pulse_length = servo_min: move to x... but like I said, it sticks after one movement and won't allow any other movement.

While I understand how the "while" code above is working, I am stuck trying to rewrite the statements to work with a button. My current code, while messy, is simplistic at best and I'd like to integrate the step speed as it works in semucon's code. I'm just stuck in a learning curve that went negative. :) My current working code is as follows:

Code: Select all | TOGGLE FULL SIZE
       
import tkinter as tk
import Adafruit_PCA9685
from tkinter import ttk


LARGE_FONT= ("Verdana", 14)
NORM_FONT = ("Verdana", 10)
SMALL_FONT = ("Verdana", 8)
resolution = 4095 # 12 bit resolution
frequency = 50 # pwm frequency in Hz
ttchannel = 0
to0channel= 0
to1channel = 1
to2channel = 2
to3channel = 3
to4channel = 4
to5channel = 5
to6channel = 6
to7channel = 7
to8channel = 8
to9channel = 9
to10channel = 10
to11channel = 11
to12channel = 12
to13channel = 13
to14channel = 14
to15channel = 15

ttservo_min = 800
ttservo_max = 2400
ttservo_center = 1600 #int((servo_min+servo_max)/2)
toservo_min = 1500
toservo_center = 1600
toservo_max = 1700
step_speed = 1 ####change to make servos move faster or slower...


class SwitchMachine(tk.Tk):

    def __init__(self, *args, **kwargs):
       
        tk.Tk.__init__(self, *args, **kwargs)
        container = tk.Frame(self)

        container.pack(side="top", fill="both", expand = True)

        container.grid_rowconfigure(0, weight=1)
        container.grid_columnconfigure(0, weight=1)

        self.frames = {}

        for F in (StartPage, SwitchPage):

            frame = F(container, self)

            self.frames[F] = frame

            frame.grid(row=0, column=0, sticky="nsew")

        self.show_frame(SwitchPage)

    def show_frame(self, cont):

        frame = self.frames[cont]
        frame.tkraise()

       
class StartPage(tk.Frame):

    def __init__(self, parent, controller):
        tk.Frame.__init__(self,parent)
        label = ttk.Label(self, text="Start Page", font=LARGE_FONT)
        label.pack(pady=10,padx=10)
       
        welclabel = ttk.Label(self, text= "Welcome to the Swtich Machine!", font = NORM_FONT)
        welclabel.pack()
        chooselbl = ttk.Label(self, text = "Please choose whether to setup HATs, or to go straight to the switch machine.", font=NORM_FONT)
        chooselbl.pack()
        sm_btn = ttk.Button(self, text = "Go to Switch Machine", command = lambda: controller.show_frame(SwitchPage))
        sm_btn.pack()



class SwitchPage(tk.Frame):

    def __init__(self, parent, controller):
        pwm1 = Adafruit_PCA9685.PCA9685(0x40)
        pwm2 = Adafruit_PCA9685.PCA9685(0x41)
        # Configure static values for PWM hat
        def set_servo_hat1(channel, pulse_length):
           
               
            pwm1.set_pwm(channel,0,int(pulse_length*frequency*resolution/1000000))
           
            pwm1.set_pwm_freq(frequency)
           
        def set_servo_hat2(channel, pulse_length):
           
            pwm2.set_pwm(channel,0,int(pulse_length*frequency*resolution/1000000))
           
            pwm2.set_pwm_freq(frequency)
           

       

   
        tk.Frame.__init__(self, parent)
        label = ttk.Label(self, text="Switch Control", font=LARGE_FONT)
        label.grid(row=0, column= 3,pady=5,padx=5)

        ttlbl = ttk.Label(self, text = "Turn Table Control", font = NORM_FONT)
        ttlbl.grid(row=1, column=0)
        trk1btn = ttk.Button(self, text ="Transfer Track", command = lambda: set_servo_hat1(ttchannel, ttservo_min))#turntable_set_min())
        trk1btn.grid(row=2,column=0)
        trk2btn = ttk.Button(self, text ="Engine  House", command = lambda: set_servo_hat1(ttchannel, ttservo_center))#turntable_set_center())
        trk2btn.grid(row=3,column=0)
        trk3btn = ttk.Button(self, text =" Parking Track", command = lambda: set_servo_hat1(ttchannel, ttservo_max))#turntable_set_max())
        trk3btn.grid(row=4,column=0)
       
        to1lbl= ttk.Label(self, text = "Inside to Outside Crossover", font = NORM_FONT)
        to1lbl.grid(row=1,column=1, padx=5, pady=5)
        to1btn1=ttk.Button(self, text = "Open", command = lambda: set_servo_hat1(to1channel, toservo_max))
        to1btn1.grid(row=2,column=1)
        to1btn3= ttk.Button(self, text = "Ctr ", command = lambda: set_servo_hat1(to1channel, toservo_center))
        to1btn3.grid(row=3,column=1)
        to1btn2=ttk.Button(self, text = "Close", command = lambda: set_servo_hat1(to1channel, toservo_min))
        to1btn2.grid(row=4,column=1)
        to1lbl= ttk.Label(self, text = "Outside to Inside Crossover", font = NORM_FONT)
        to1lbl.grid(row=1,column=2, padx=5, pady=5)
        to1btn1=ttk.Button(self, text = "Open", command = lambda: set_servo_hat1(to2channel, toservo_max))
        to1btn1.grid(row=2,column=2)
        to1btn3= ttk.Button(self, text = "Ctr ", command = lambda: set_servo_hat1(to2channel, toservo_center))
        to1btn3.grid(row=3,column=2)
        to1btn2=ttk.Button(self, text = "Close", command = lambda: set_servo_hat1(to2channel, toservo_min))
        to1btn2.grid(row=4,column=2)
        to1lbl= ttk.Label(self, text = "Inside to Mine", font = NORM_FONT)
        to1lbl.grid(row=1,column=3, padx=5, pady=5)
        to1btn1=ttk.Button(self, text = "Open", command = lambda: set_servo_hat1(to3channel, toservo_max))
        to1btn1.grid(row=2,column=3)
        to1btn3= ttk.Button(self, text = "Ctr ", command = lambda: set_servo_hat1(to3channel, toservo_center))
        to1btn3.grid(row=3,column=3)
        to1btn2=ttk.Button(self, text = "Close", command = lambda: set_servo_hat1(to3channel, toservo_min))
        to1btn2.grid(row=4,column=3)
        to1lbl= ttk.Label(self, text = "Mine to Hanging Bridge", font = NORM_FONT)
        to1lbl.grid(row=1,column=4, padx=5, pady=5)
        to1btn1=ttk.Button(self, text = "Open", command = lambda: set_servo_hat1(to4channel, toservo_max))
        to1btn1.grid(row=2,column=4)
        to1btn3= ttk.Button(self, text = "Ctr ", command = lambda: set_servo_hat1(to4channel, toservo_center))
        to1btn3.grid(row=3,column=4)
        to1btn2=ttk.Button(self, text = "Close", command = lambda: set_servo_hat1(to4channel, toservo_min))
        to1btn2.grid(row=4,column=4)
        to1lbl= ttk.Label(self, text = "Wye to Hanging Bridge", font = NORM_FONT)
        to1lbl.grid(row=1,column=5, padx=5, pady=5)
        to1btn1=ttk.Button(self, text = "Open", command = lambda: set_servo_hat1(to5channel, toservo_max))
        to1btn1.grid(row=2,column=5)
        to1btn3= ttk.Button(self, text = "Ctr ", command = lambda: set_servo_hat1(to5channel, toservo_center))
        to1btn3.grid(row=3,column=5)
        to1btn2=ttk.Button(self, text = "Close", command = lambda: set_servo_hat1(to5channel, toservo_min))
        to1btn2.grid(row=4,column=5)
        to1lbl= ttk.Label(self, text = "Trestle to Inside", font = NORM_FONT)
        to1lbl.grid(row=1,column=6, padx=5, pady=50)
        to1btn1=ttk.Button(self, text = "Open", command = lambda: set_servo_hat1(to6channel, toservo_max))
        to1btn1.grid(row=2,column=6)
        to1btn3= ttk.Button(self, text = "Ctr ", command = lambda: set_servo_hat1(to6channel, toservo_center))
        to1btn3.grid(row=3,column=6)
        to1btn2=ttk.Button(self, text = "Close", command = lambda: set_servo_hat1(to6channel, toservo_min))
        to1btn2.grid(row=4,column=6)
        to1lbl= ttk.Label(self, text = "Inside Wye To Turntable", font = NORM_FONT)
        to1lbl.grid(row=1,column=7, padx=5, pady=5)
        to1btn1=ttk.Button(self, text = "Open", command = lambda: set_servo_hat1(to7channel, toservo_max))
        to1btn1.grid(row=2,column=7)
        to1btn3= ttk.Button(self, text = "Ctr ", command = lambda: set_servo_hat1(to7channel, toservo_center))
        to1btn3.grid(row=3,column=7)
        to1btn2=ttk.Button(self, text = "Close", command = lambda: set_servo_hat1(to7channel, toservo_min))
        to1btn2.grid(row=4,column=7)
        to1lbl= ttk.Label(self, text = "Outside to Wye", font = NORM_FONT)
        to1lbl.grid(row=5,column=0, padx=5, pady=5)
        to1btn1=ttk.Button(self, text = "Open", command = lambda: set_servo_hat1(to8channel, toservo_max))
        to1btn1.grid(row=6,column=0)
        to1btn3= ttk.Button(self, text = "Ctr ", command = lambda: set_servo_hat1(to8channel, toservo_center))
        to1btn3.grid(row=7,column=0)
        to1btn2=ttk.Button(self, text = "Close", command = lambda: set_servo_hat1(to8channel, toservo_min))
        to1btn2.grid(row=8,column=0)
        to1lbl= ttk.Label(self, text = "Inside to Engine House", font = NORM_FONT)
        to1lbl.grid(row=5,column=1, padx=5, pady=5)
        to1btn1=ttk.Button(self, text = "Open", command = lambda: set_servo_hat1(to9channel, toservo_max))
        to1btn1.grid(row=6,column=1)
        to1btn3= ttk.Button(self, text = "Ctr ", command = lambda: set_servo_hat1(to9channel, toservo_center))
        to1btn3.grid(row=7,column=1)
        to1btn2=ttk.Button(self, text = "Close", command = lambda: set_servo_hat1(to9channel, toservo_min))
        to1btn2.grid(row=8,column=1)
        to1lbl= ttk.Label(self, text = "Inside to Engine House To Parking", font = NORM_FONT)
        to1lbl.grid(row=5,column=2, padx=5, pady=5)
        to1btn1=ttk.Button(self, text = "Open", command = lambda: set_servo_hat1(to10channel, toservo_max))
        to1btn1.grid(row=6,column=2)
        to1btn3= ttk.Button(self, text = "Ctr ", command = lambda: set_servo_hat1(to10channel, toservo_center))
        to1btn3.grid(row=7,column=2)
        to1btn2=ttk.Button(self, text = "Close", command = lambda: set_servo_hat1(to10channel, toservo_min))
        to1btn2.grid(row=8,column=2)
       
        to1lbl= ttk.Label(self, text = "Wye To Outside EH", font = NORM_FONT)
        to1lbl.grid(row=5,column=3, padx=5, pady=5)
        to1btn1=ttk.Button(self, text = "Open", command = lambda: set_servo_hat1(to11channel, toservo_max))
        to1btn1.grid(row=6,column=3)
        to1btn3= ttk.Button(self, text = "Ctr ", command = lambda: set_servo_hat1(to11channel, toservo_center))
        to1btn3.grid(row=7,column=3)
        to1btn2=ttk.Button(self, text = "Close", command = lambda: set_servo_hat1(to11channel, toservo_min))
        to1btn2.grid(row=8,column=3)
       
        to1lbl= ttk.Label(self, text = "Shits and Grins", font = NORM_FONT)
        to1lbl.grid(row=5,column=4, padx=5, pady=5)
        to1btn1=ttk.Button(self, text = "Open", command = lambda: set_servo_hat2(to0channel, toservo_max))
        to1btn1.grid(row=6,column=4)
        to1btn3= ttk.Button(self, text = "Ctr ", command = lambda: set_servo_hat2(to0channel, toservo_center))
        to1btn3.grid(row=7,column=4)
        to1btn2=ttk.Button(self, text = "Close", command = lambda: set_servo_hat2(to0channel, toservo_min))
        to1btn2.grid(row=8,column=4)
       
        to1lbl= ttk.Label(self, text = "Craps and Crackers", font = NORM_FONT)
        to1lbl.grid(row=5,column=5, padx=5, pady=5)
        to1btn1=ttk.Button(self, text = "Open", command = lambda: set_servo_hat2(to1channel, toservo_max))
        to1btn1.grid(row=6,column=5)
        to1btn3= ttk.Button(self, text = "Ctr ", command = lambda: set_servo_hat2(to1channel, toservo_center))
        to1btn3.grid(row=7,column=5)
        to1btn2=ttk.Button(self, text = "Close", command = lambda: set_servo_hat2(to1channel, toservo_min))
        to1btn2.grid(row=8,column=5)
       
                 


 



app = SwitchMachine()
app.geometry("1280x720")
app.title("BB&C Switch Machine")
app.mainloop()                 

Hardball1911
 
Posts: 6
Joined: Fri Aug 31, 2018 9:14 am

Re: Something simple Im missing...

by adafruit_support_mike on Tue Sep 11, 2018 1:30 am

Thanks.

My first suggestion is to drop back to what are called 'toy programs' to get familiar with the pieces you're using. The hardest part of deugging code is finding the place where things stop working the way you expected, and the more moving pieces you have, the more places problems can hide. Toy programs strip one piece of programming down to its simplest terms, without a lot of extra stuff cluttering up your attention.

I'm only vaguely familiar with Tk, but I know it has a lot of settings and options. If you're just starting with it, write a program with one button and get it to print something simple like, "hello." when you click it. Once you're comfortable with that, add a second button make it print something else. Just alternating between two buttons can potentially be enough to keep you trying stuff and reading documentation for a while.

As a general development pattern, start small and advance in small steps. At each step, make sure you have everything working the way you expect, and make sure you understand what every line of code is doing before moving on. You have to upload all of that information into your mind to write the overall program, and it's much, much easier to do it one piece at a time.

adafruit_support_mike
 
Posts: 55974
Joined: Thu Feb 11, 2010 2:51 pm

Re: Something simple Im missing...

by Hardball1911 on Tue Sep 11, 2018 9:43 am

As for toy code, I certainly understand the concept.

I am not unfamiliar with coding, just Python and tkinter. It isn't the tkinter that is causing the issues, it is my construction of the for,while, and if statements in Python.

I know it is something simple, but I got stuck on inclusion of the step_speed for whatever reason. I don't consume nearly the amount of caffeine I once did so it is what it is, as they say.

So, this code is what I want to do, however, I don't want to use a while loop. When I write something similar, the code performs its task, but only once and in one direction... I also know that questions should be fairly specific, so I will try to state that next:
Code: Select all | TOGGLE FULL SIZE
try:

    pwm.set_pwm_freq(frequency)
    set_servo(channel, servo_centre)

    while True:

        # move from central to max
        print('Moving servo from centre to max {0}'.format( servo_max))
        for i in range (servo_centre, servo_max, step_speed):
            set_servo(channel,i)
        sleep(.5)
       
        # Move from max to min
        print('Moving servo from max {0} to min {1}'.format(servo_max, servo_min))
        for i in range (servo_max, servo_min, step_speed * -1):
            set_servo(channel,i)
        sleep(.5)

        # move from min back to centre   
        print('Moving servo from min {0} to centre'.format(servo_min))
        for i in range (servo_min, servo_centre, step_speed):
            set_servo(channel,i)
        sleep(.5)

except KeyboardInterrupt:
    print ("\nKeyboard Interrupt!\n")


The question I am asking I suppose is for advice as to what direction I should take. I know it should be a function such as:
Code: Select all | TOGGLE FULL SIZE
def open_button_press():




But...

Hardball1911
 
Posts: 6
Joined: Fri Aug 31, 2018 9:14 am

Re: Something simple Im missing...

by adafruit_support_mike on Wed Sep 12, 2018 4:58 am

It sounds like you want to unroll the loops and switch over to a continuous, state-based process.

Instead of having the basic unit of action be, 'move all the way to the new position,' you can use 'move a small distance in a specified direction' with the specifed values being 'left', 'right', and 'none at all'.

That turns the rest of the code into a process of defining an endpoint, tracking the current position, and deciding what direction to use for the next step based on the difference between the two:

Code: Select all | TOGGLE FULL SIZE
def sso( x, y ):    #  substitute for the Perl spaceship operator <=>
    return( 0 if x==y else ( -1 if x < y else 1 ))

step = sso( endpoint, position )
if ( step ):
    position += step
    servo.set_pwm( channel, 0, convert_position_to_pulse_width( position ) )

if ( check_for_input() ):
    # change endpoint value based on input
You can simplify logic trees and error handling dramatically by arranging things for the states { null, A, B } where A and B cover all possible non-null input values. A related technique is to pass data values as lists that can have zero, one, or many items.

Strictly speaking, you could eliminate the if( step ) statement from the code above and it would still work, it would just keep sending the PWM generator the same pulse width over and over.

The idea of breaking large operations down into a sequence of small changes is stolen from calculus. In numerical approximation, it's called a 'difference equation', where the next value of a variable depends on some function of the previous value. If the steps become infinitely small, it turns into a differential equation. It's an powerful technique, capable of producing highly complex behavior from just two or three continuously-updated variables.

adafruit_support_mike
 
Posts: 55974
Joined: Thu Feb 11, 2010 2:51 pm

Re: Something simple Im missing...

by Hardball1911 on Wed Jan 09, 2019 11:21 am

Mike, I should have posted this much earlier, however, I wanted to update you and say thanks for the input.

Too often we approach others' problems with a state of mind that make them seem easy in our own heads, but convey a response that gives the impression that, A.) we don't really want to offer a solution, and B.) place ourselves "above" others with respect to knowledge and understanding. Often times when asking a question the non-responses, or responses with minimal help, outweigh the actual constructive assistance.

In this case, you made me actually rethink the problem and approach a different way. Thank you for that, and thank you for what you all do. I've been steadily learning Python along with tkinter, so the solutions aren't always as obvious as what you gave me, as sometimes you don't know what you don't know until you know it!

Again, thanks for the help. This is why I will continue to support Adafruit!

Hardball1911
 
Posts: 6
Joined: Fri Aug 31, 2018 9:14 am

Re: Something simple Im missing...

by adafruit_support_mike on Sat Jan 12, 2019 1:14 am

Thank you, I appreciate that.

I'm glad to hear the ideas were useful. We do try to lean toward ways of thinking about a problem instead of just saying, "do this". Choosing a good strategy is usually harder than implementing it.

adafruit_support_mike
 
Posts: 55974
Joined: Thu Feb 11, 2010 2:51 pm

Re: Something simple Im missing...

by Hardball1911 on Sat Jan 12, 2019 10:27 pm

I solved the issue, right after I realized your approach to the problem was very close to what was in the example i posted already. I just had to step back and evaluate my approach with a little more objectivity and a little less curiosity (at learning the language). After all, most programming language functions are fairly similar take away the syntax.

One issue I had/have, is that I am learning Python and tkinter from "scratch". I've coded in a ton of languages since the Basic days (10 Print "Hello World" 20 GoTo...) and figuring out the logic behind each language's "author" is part of the learning process as well. Sometimes when one is learning a language, whether it be computer or verbal, one can get wrapped up in the language structure so much they forget what they are trying to communicate! :D

I just had to get out of my own way and you reminded me of the forgotten part of the process.

I appreciate it.

Hardball1911
 
Posts: 6
Joined: Fri Aug 31, 2018 9:14 am

Re: Something simple Im missing...

by adafruit_support_mike on Sun Jan 13, 2019 5:39 am

I know what you mean.. each language does have its own worldview, and you need to internalize that to use the language effectively.

I'll admit that Python wouldn't be my language of choice for working out new ideas.. it's prescriptive by design, so it's easy to spend more time researching the way the language wants you do to something than solving a project's actual design problems.

adafruit_support_mike
 
Posts: 55974
Joined: Thu Feb 11, 2010 2:51 pm

Re: Something simple Im missing...

by Hardball1911 on Sun Jan 13, 2019 2:11 pm

I'll post my solution soon, with the indication that it is very specific to what I wanted to accomplish. I have already begun the process of writing an all around "customizable" setup for others to use, just for kicks. Because it is just for kicks, we'll see if I ever complete it, but hey, I've got nothing better to do at present, so I continue to model (as in make little things that look like big "real" things) and write some code for the model to animate.

I already know I'm going to have to work out a solution for a continuous rotation servo now, as I'm going to build my own Turn Table for a model train. As buying one can be upward of $300US, typically analog, and not very smart in its automation, I think I can build one cheaper and have it be better than that money spent.

Thanks again for the help Mike!

Chris

Hardball1911
 
Posts: 6
Joined: Fri Aug 31, 2018 9:14 am

Re: Something simple Im missing...

by adafruit_support_mike on Mon Jan 14, 2019 3:29 am

Yeah, you should be able to make something quite good for a lot less than $3k.

Post photos along the way.. there's a long and respected shared history between electronics and model trains. ;-)

adafruit_support_mike
 
Posts: 55974
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.