I want to make my raspberry pi ask me a question, but not with sound, with text. I learned how to do it a while ago, but I forgot.
Like @Ghanima said in the comments, this question is a bit too non-specific and I'm not sure exactly what you want. However, I think I can provide a basic answer.
Python is the language of choice for the Raspberry Pi (the Pi in the name is a take on Python) and comes pre-installed on Raspbian, so the example I'll provide will be in Python.
A basic Q/A script written in Python 3.3, you can run it via
print("Hey there!") going = input("How's it going? ") print ("Oh that's great! It's going",going,"for me too") age = input("How old are you? ") print ("Really?",age,"is a great age!") print ("Okay, bye for now!")
However, in the case of
print ("Oh that's great! It's going",going,"for me too") and
print ("Really?",age,"is a great age!"), you'll notice the quotation marks end, and are followed by a comma, then a variable (
age respectively.) Like this:
This is one way, in Python, you can print data that a variable is holding. The commas insert a space while the variable tells what to print.
And that brings me to the next point, variables. In the
going = input("How's it going? ") and
age = input("How old are you? ") lines, you'll notice a word, then an equals sign (=), then input.
The first word (
age respectively) is the variable that the input statement will put its input in. In simpler terms, the first word stores what you give the computer when it asks. If you enter
good! for the first question, the computer will store
good! in the
That's all I'm going to share, I don't want to give a full lesson on Python code within the bounds of a Stack Exchange answer. Again, if you want to learn more about Python, follow those links I gave above.
Hope this helped!