Shop OBEX P1 Docs P2 Docs Learn Events
Any ideas? — Parallax Forums

Any ideas?

SONIC the HedgehogSONIC the Hedgehog Posts: 321
edited 2012-01-24 17:37 in Propeller 1
So I'm pretty bored right now and would like to take a break from the simple LED projects the learning book that comes with the propeller educational kit comes with, so does anybody have any good ideas or schematics for some fun bread wording projects with the propeller?
«1

Comments

  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-01-21 22:40
    On my QuickStart board, I wrote a program that had the 8 LEDs scanning back and forth, but with PWM, so it would fade from one LED to the next. In another cog, I was reading touch sensors and lighting the adjacent LED.

    The touch sensors are just pads with adjacent grounds. They do have 100k resistors going to the I/O pins, but that's just for static safety. The same code will work with the touch pads going straight to I/O pins without killing the prop as long as you have an anti-static wrist strap or a finger on a ground somewhere.

    Do that. If you need more hints, ask, but it seems you're more interested in figuring it out for yourself than getting help. By the way, that's awesome.
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-01-21 22:43
    Or, if you're feeling really adventurous, wire up a Sega controller, look up the protocol, and light LEDs with that.

    Next step, hook up a VGA output and use one of the low resolution VGA graphics interfaces to interact with the Genesis/Mastersystem controller.

    Step 3: Start re-implementing Sonic The Hedgehog.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-22 06:00
    Now that sir is genes. I think actually I will stick with the nine pin genesis controller so I could also use an atari joystick or paddle if I wanted. Okay it's sonic, once I learn about the protocol...........and get past the las chapter so I can use assembly..........and get my VGA out..........
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-22 06:02
    And get a nine pin controller input. Or I guess it could take the one I have now and see if it was like my other regular six button and the wires just came unpronged.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-22 09:39
    So for all of those who just read this, I just found something to do. I got bored and took a good look at my atari 2600 joystick. I found that wires very easily could be put in them. So I round the pin out and here I am pressing a red button and moving the joystick turning on LEDs! Who knew that could be oh so much fun.
  • TtailspinTtailspin Posts: 1,326
    edited 2012-01-22 10:33
    Good work Sonic the Hedgehog, Turns out, boredom is an insult to yourself, so it is important to act as soon as it is noted...:)

    Say, would you consider posting the code you've written? for that others may join in the fray against the boredom monster.:zombie:


    -Tommy
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-22 10:42
    I will post a schematic, but I didnt use any code. The schematic is simple.
    connect pin 8 to ground
    1 is up on joystick
    2 is down on joystick
    3 is left on joystick
    6 is the button
    8 is ground
    all the other pins don't have function
    5 4 3 2 1
    9 8 7 6
    I'm planning on writing code as soon as I figure out how to get the prop to recongize my joystick as an input. The joystick outputs ground, but doesnt the propeller only recognize positive voltage input?
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-22 11:18
    Well, I tried doing the whole ina command just to test if it works, and it doesn't recognize ground as input. So I tried connecting pin eight to plus 4.5 volts, and it still didn't work. I then tried 3 and once again, no lights.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2012-01-22 11:39
    There is code and a schematic of sorts...

    This may help you: http://obex.parallax.com/objects/87/

    OBC
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-22 11:59
    If you have a Wii Nunchuck or a PlayStation 2 controller, you could use those with a Prop. I'm pretty sure there are objects for them in the OBEX.

    I know there are other game controllers that work with the Prop but the two I mentioned are he ones I use the most.
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-01-22 13:19
    Well, I tried doing the whole ina command just to test if it works, and it doesn't recognize ground as input. So I tried connecting pin eight to plus 4.5 volts, and it still didn't work. I then tried 3 and once again, no lights.
    Leave them connected to ground, but put pull-up resistors (~10K or so) to 3.3V on each pin.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-22 13:33
    I will try that and see how it goes. I will post my results later.
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-01-22 14:30
    So for all of those who just read this, I just found something to do. I got bored and took a good look at my atari 2600 joystick. I found that wires very easily could be put in them. So I round the pin out and here I am pressing a red button and moving the joystick turning on LEDs! Who knew that could be oh so much fun.
    But, but.... IT'S NOT A SEGA CONTROLLER!!! </rant>

    From what I recall, the Sega Genesis controller is a parallel interface, so it shouldn't be too hard to interface to a prop.
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-01-22 16:52
    The Wii Classic Controller is a nice I2C product and cheap off eBay. You could interface it quite easily. You need to supply it with 3v3 (not 5V) although I understand noone seems to have destroyed it. I have a tiny pcb that will plug into your Wii and has an onbard 3v3 regulator (smt) which can be bypassed. Alternately, buy a Wii extension cable from eBay and cut the end off and solder the cable to a pin header.

    The wii motion plus has a 3 axis gyro and the wii numchuck has an accelerometer. The nunchuck can connect to the motion plus (daisy chain). Objects have already been written for these. I am using these pcbs scavenged for my quadcopter - see the build thread for the long quadcopter build thread.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-22 20:37
    But, after wiring the atari controller, I stayed true to my roots and began wiring a genesis controller to my board. The interface is fine, my only problem is is that I got a six button mode with turbo and slow sega genesis controller so I'm going to go the extra mile and support with those for any games I decode to make with it. I will post any functioning drivers Kandahar demos along with schematics to obex!
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-22 20:39
    About the Kandahar, I'm typing on my iPad( my school is awesome and the entire school got iPads) and sometimes I hit the n instead of space so i was typing and, and probably hit m and n somewhere in there and autocorrect took over....
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-23 17:37
    Well I added the pull up resistors, 10k each, and it didn't work. The I turned on the power to my board, and the LEDs lit right up. Pressing the button and moving the joystick up and down turns it off.
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-01-23 18:27
    Sounds like you have something shorted somewhere that you shouldn't.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-23 18:31
    I'm actually a little confused. I have ground on pin 8, then I took the pull up resistors, and connected them to +4.5 volts. At the end of the resistor is the actual pin on the controller, BUT in between the pin and resistor lead is the wire that goes to the LEDs and is connected to the anode.
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-01-23 20:02
    Well, for one thing, the LED has enough voltage drop that the prop will always see logic high. Connect the controller pins directly to the prop pins and provide 10k pullups to 3.3v. From there, you can connect 330 ohm resistors from +4.5 to the anodes of the LEDs, and the cathodes to controller pins.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-24 04:19
    Huh. I didn't think of it like that, but I will try.the only thing I question is if use these pull up resistors to provide 3.3v to the controller pins that are connected to the prop, won't it detect an input just because the positive voltage from the 3.3v will get to the pins?
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-01-24 05:36
    According to post #8 that's how it should work:
    The resistor is driving the input pin to high while the switches inside the keypad will drive it low whenever a button is pressed.

    Of course in your programs you have to react on low - this is called an active low signal.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-24 07:10
    But I still don't really understand how these resistors drive the input pin high. Could someone please explain? It would help if someone does because then I think understanding how it's works is part of building it.
  • xanaduxanadu Posts: 3,347
    edited 2012-01-24 09:37
    But I still don't really understand how these resistors drive the input pin high. Could someone please explain? It would help if someone does because then I think understanding how it's works is part of building it.

    To pull a pin high is to provide voltage to the pin so that in the absence of external signal (buttons, etc) it doesn't drift high or low on its own. It's basically keeping it on to make sure that the only thing that turns it off is the (switch,etc). External signal comes into the pin through a much lesser value resistor allowing it to override the pullup or pulldown resistor.

    Hope I explained that ok.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-24 09:42
    Oh that's makes a bunch of sense actually. So now I do understand the using 3.3 volts. I drew up a schematic, but can't upload it right now. I will have to do that later. Thanks for the help so much, and I only have one last question. Would I do this for any circuit that needs input from a device that emits grounded signals?
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-01-24 09:43
    ????

    You connect one side of the resistor to 3,3V. The other side directly goes to the propeller-pin. This means that without anything else the propeller pin will see the 3,3V through the resistor => HIGH.
    From this pin you now go to one of the pins of the controller - say the one for UP. The controller simply contains switches which switch the according controller-pin to ground - if you connected ground of the controller with ground of the propeller.
    As the switch has a much lower resistance than the resistor, the whole voltage drops on the resistor, which on the other hand means that the propeller-pin will see the 0V side of the resistor => LOW.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-24 09:46
    THANK YOU SO MUCH!!!!!!! I think you just solved it for me, so I will have to change my schematic, but this helps a bunch!
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-24 15:19
    I tried that and it didn't work. The propeller didn't recognize the high or low signals actually. I wired the ground on the controller to a +6 volt input and and touched the lead from the button to a 10 ohm resistor that is connected to the positive supply, and nothing. I up the voltage to +9v and the LEDs turned on, but the propeller still did not recognize. I assume the propeller didn't pick it up because the current was probably more than 20mA
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-01-24 16:06
    Wow ... you should really learn the basics of electronics with cheaper parts than with propellers!

    "I wired the ground on the controller to a +6 volt", "I up the voltage to +9v" .... it hurts to read that! Why do you think is ground called ground?
    With 9V connected to a propeller pin, that pin might not recognize anything anymore!
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-01-24 16:14
    I've really only been working with electronics for a good month. I've been learning fast, but I've worked with software for more than a year, so I do need more time wo the hardware. The pin works because I confirmed that with a simple outa and ammeter. I wired it EXACTLY as you said above and it didn't work. All the LEDs were lit up from the start, but pressing the buttons from atari controller didn't change anything. I'm not so much as confused as why it should work, I kinda get the whole pull up resistor and how it goes from high and then to low and stuff. Like I said, actually tomorrow would mark the first month I've been working with any sort of Breadboard, and I think I'm still learning at a great pace anyways. About two days after I got my propeller I turned a binary to decimal keypad into a timer that counts down 10 secs, then buzzes. Pressing the button to activate again will reactivate it too. So I'm off to a good start.
Sign In or Register to comment.