Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Storing and transmitting char const

Status
Not open for further replies.

hithesh123

Full Member level 6
Joined
Nov 21, 2009
Messages
324
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Location
lax
Activity points
3,548
I am designing a keyboard key emulator.
Each key on the keyboard has a hex code. I can store this in a header file as constants. For example const char A=0x1C;

When I call a function with text string as the passing parameter, I want to transmit the hex codes corresponding to the string characters.
For example, if I call the function trans_string(ABCD)

I want this function to transmit hex codes corresponding to the alphabets A, B , C and D.
 

OK. When you press A, B, C, D then you want too transmit 0x1C, 0x1D, 0x1E, 0x0F say. You can use UART to send data. trans_string() function will have a switch(key) statement. Depending upon the key pressed it will send the corresponding code for the key stored in a array.
 

OK. When you press A, B, C, D then you want too transmit 0x1C, 0x1D, 0x1E, 0x0F say. You can use UART to send data. trans_string() function will have a switch(key) statement. Depending upon the key pressed it will send the corresponding code for the key stored in a array.

I managed to accomplish that part. But I have new problem now.
The hex codes need to go out bit by bit.
I cannot use any built in functions like UART. I have bit bang.
But don't know how to send each bit of the hex data.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top