Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumProgramming Questions & HelpSyntax › How to prompt User...

Page Index Toggle Pages: 1
How to prompt User... (Read 5025 times)
04/11/10 at 15:00:09

Chocolate_Chip   Offline
YaBB Newbies

Posts: 3
*
 
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! 

 
IP Logged
 
Reply #1 - 04/12/10 at 04:33:01

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
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.
 
IP Logged
 
Reply #2 - 04/13/10 at 00:19:21

Chocolate_Chip   Offline
YaBB Newbies

Posts: 3
*
 
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!  Smiley
 
IP Logged
 
Reply #3 - 04/17/10 at 23:03:53

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
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?
 
IP Logged
 
Reply #4 - 04/18/10 at 16:54:23

Chocolate_Chip   Offline
YaBB Newbies

Posts: 3
*
 
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,
 

 
IP Logged
 
Reply #5 - 04/19/10 at 04:44:11

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
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?
 
IP Logged
 
Page Index Toggle Pages: 1