Wiring Forum
http://wiring.org.co/cgi-bin/yabb/YaBB.pl
Programming Questions & Help >> Syntax >> How to prompt User...
http://wiring.org.co/cgi-bin/yabb/YaBB.pl?num=1270998009

Message started by Chocolate_Chip on 04/11/10 at 15:00:09

Title: How to prompt User...
Post by Chocolate_Chip on 04/11/10 at 15:00:09
Hi all,
I was wondering how can I prompt user to add their name or any other information before I send an input to the board?

So basically,
"Please enter your name" 
<User enters their name>
<Send input(push button) to the board>
<Outputs results>

For name, do I need to create  a separate method? 

Q2. How can I print results of the program on a hard copy? When I hit "print" from the wiring program, it prints the code.

Q3. What library can I use to include date when I run the program?

Thank you! 


Title: Re: How to prompt User...
Post by barragan on 04/12/10 at 04:33:01
how are you planning to receive text from the user? keyboard? what type?
It is possible to connect LCD or LED displays, it is also possible to connect Wiring to a computer and have an application running to capture the user data and then send it to the Wiring board just using the serial port.

Title: Re: How to prompt User...
Post by Chocolate_Chip on 04/13/10 at 00:19:21

barragan wrote on 04/12/10 at 04:33:01:
how are you planning to receive text from the user? keyboard? what type?
It is possible to connect LCD or LED displays, it is also possible to connect Wiring to a computer and have an application running to capture the user data and then send it to the Wiring board just using the serial port.




Hi,

The user will enter text(name) through the computer keyboard.


Basically this is what I am doing.

http://wiring.org.co/learning/basics/multipleswitches.html

When a switch is turned on, the result is "ON" and this is outputted in the wiring output window (LOOP Method).

In the code from the above website, before the Loop() method is run, I want to ask the user to enter their name. How can I do that? Is it possible?

Also, how can I print the results (through  printer) from the wiring output window in the form of a hard copy?

Thanks for your help!  :)

Title: Re: How to prompt User...
Post by barragan on 04/17/10 at 23:03:53
I am not sure I understand what you;re trying to do. Do you mean to connect a USB keyboard directly to the Wiring board? Or are you using the keyboard with a PC and then send the data to Wiring through the serial?

Title: Re: How to prompt User...
Post by Chocolate_Chip on 04/18/10 at 16:54:23
What I am trying to do is :
I have couple of LED push buttons and i will wire them to the wiring board and connect the wiring board to PC using the USB cable.
In my code first I want to ask user to enter his name, the user should be able to enter his name through the serial monitor.
- In the second step when user press the push button, and when the contact is made, i want the code to print "ON" else "OFF".

at the end I want to use printer to print whatever comes on the output window.

I am sorry I am new to programming, I know what I want to do and it is a simple code but I am not good in writing a code. 
I really appreciate your help.

Thanks,
 

    

Title: Re: How to prompt User...
Post by barragan on 04/19/10 at 04:44:11
Seria.print will print to the console whatever you order to print, then from the Wiring serial monitor you can type anything and that will go to the Wiring board, this example echoes back whatever the serial receives (data from the serial monitor for example) http://wiring.org.co/learning/libraries/simplereadwrite.html does this helps to what you're trying to do?

Wiring Forum » Powered by YaBB 2.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.