Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8346079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:53:29+00:00 2026-06-09T06:53:29+00:00

I do not know how I can obtain user inputs from a keyboard and

  • 0

I do not know how I can obtain user inputs from a keyboard and display those inputs to a terminal emulator (Real term).

I usually do the following to set up the stdin. However, I do realize that I cannot have the word KEYBOARD as a stream.

   FILE receive_str = FDEV_SETUP_STREAM(NULL, KEYBOARD , _FDEV_SETUP_READ);
   stdin = &receive_str;

The program is compiled with AVR Studio 4.18 under Windows 7, targeting an ATmega 32 microcontroller.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:53:31+00:00Added an answer on June 9, 2026 at 6:53 am

    See http://www.nongnu.org/avr-libc/user-manual/group__avr__stdio.html for information on the FDEV_SETUP_STREAM method of setting up stdio. In particular, what you put as “KEYBOARD” in your example above is supposed to be the function that provides the keyboard input. So the way you’ve written your code means that it’s looking for a function like this:

    int KEYBOARD(FILE *stream)
    {
        return 'A';   
    }
    

    This would be a stream that always returns the letter A, for example. Of course, it’s up to you to fill in that function with whatever code is necessary to read from whatever keyboard hardware you have connected to your microcontroller.

    The avr-libc manual linked above describes the other values you can return from this function, too, like _FDEV_ERR (if an error occurred) or _FDEV_EOF (if it’s the end-of-file, i.e., there is no more input to read).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need create clone repository. but I do not know where can I get
I know you can not set a key value dynamically, but what about the
I know you can use -fno-objc-arc flag to disable ARC for files that NOT
I know I can read off /proc/[id]/maps but I'm not sure if the first
I know I can combine tables with sql queries, but that's not what I
I want to know i can do something similar to this (not working) code
This question is not language-aware. I wanna know how can I recognize a returning
I'm not friendly with C# programming, so I don't know what can be replaced
Now while I know that you can not perform inheritance like you would in
I know that there can be multiple values for an email, but I'm not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.