NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » PuTTY don't like me...
February 13, 2010 by Herover |
Hi, I made a simple file combining the code from the Servo Squirter and blinking LED, to make a LED blink when a key is pressed - I wanted to find out how to communicate with the microcontroller. When I open up putty.exe it shows me the window from your picture and I fill it out like you did, but then I run the program (while the microcontroller is on with the program) and just show me a black window with a green square. I can't write anything, and nothing happen when I try. Help me! And I use Vista. |
---|---|
February 13, 2010 by treymd |
quick test... put the yellow and green wire from your cable in the same row so that you get a loopback connection. Open putty and type, if everything you type shows up, then your serial port settings are correct. If not, the most likely problem is that you have selected a different COM port than the one the nerdkit is actually on. There could be of course other bugs, but this simple test can eliminate one of them. |
February 13, 2010 by Herover |
Okey, it show all I type. It did actually also type 'ba', and sometimes other kind of funny stuff, when I turned the controller off earlier (couldn't stop testing after I did this post). Also, I guess that it's my code that's something wrong with. If I open putty before I turn it on, nothing happen. But if I turn it on meanwhile, it makes the LED light up, but now it wont stop! In the main function it do
(stolen from "led_blink.c" and the usb controlled water-thing) I'm not sure about how nice the LED part is, so here's my way of checking it with LCD in a "while(1)" loop:
Before pressing a button in pytty: blank. After: it write some letters, some " " and a kind of "4" letter. Line two say "||". |
February 13, 2010 by Herover |
A little edit: Line one: "|| " and a funny "4" (like in handwriting). Line two: "48". No difrence if i press another key. |
February 13, 2010 by pbfy0 |
is
for your while() loop. |
February 14, 2010 by Herover |
Thanks, sure it's only my program that doesn't work as I want it. But how should I check if it's the right button thats pressed? Right now it looks like this:
No mater what character I press, it believe it's the right one... Something else I don't get is why even the LCD write the letter 'tc' should bee, even when I change that character or press another one. |
February 14, 2010 by mcai8sh4 |
guessing here, but have you tried '==' as in tc=='b' |
February 14, 2010 by Herover |
Oh, it works!!! Screen is still showing 'b' but that's not a problem right now :) THANKS! (and I found the "tc='b'" in the "Servo Squirter" example code, should that be fixed too?) |
February 14, 2010 by Phrank916 |
The servosquirter code I have (from the code.zip download) definitely has the == operator in the correct place. Remember that a single = is a declaration (or assignment) operator. The double == is a relational (or comparison) operator which means equal to. The single = in the line tc=uart_read(); is OK because you are declaring the variable tc to equal the return value of the uart_read function. In those other lines (the IF/THEN) you are comparing a variable with a value and checking IF it's exactly equal to that value using the == operator, THEN you doing something.. Took me a bit to get that too. :) Ted |
February 15, 2010 by Herover |
Thanks, guess I have to learn that :) I think I also figured out why LCD only shows the character that equals true.... The stream dosen't send the correct character all the time, like it send a part of it, which is seems corect, and then it think it's the right one? Not very precise... |
Please log in to post a reply.
Did you know that you can connect a pushbutton to a microcontroller with only one wire? Learn more...
|