Go Down

Topic: using arsduino to control oscillator (Read 686 times) previous topic - next topic

Nasty_Nesto

Hello.  I would like my arduino to sent out data in hex via usb to an external 4 channel oscillator.  How can i program the arduino to output hex in response to a button push?

jremington

In computers, data are stored and transmitted in binary form. Hex, decimal, ASCII etc. are human readable representations of binary data.

If you will post a link to the product page or data sheet for your device, forum members can help.

wvmarle

Like this:

Code: [Select]

if (buttonPressDetecte()) {
  doHexOutput();
}


I'll leave the implementation of the two functions to you. Also you may want to add state change detection here (see the IDE example).

The "via USB part" can be done by printing your output to the Serial interface, which connects to the USB socket of the Arduino.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

gilshultz

#3
Feb 22, 2020, 02:49 am Last Edit: Feb 22, 2020, 02:51 am by gilshultz
To me a HEX file is ASCII encoded data in byte format comprised of the digits 0-9 and the letters A-F which will encode 4 Bits. These digits are pared into 8 bit ASCII bytes. The Arduino will do the conversion for you, try Serial.print(x,HEX) and you can see what it is. If you search you will find many ways of doing this on the web. First I would recommend you understand what the external 4 channel oscillator needs and how it is to be structured. You can start by creating strings with what you want then just send them to the external 4 channel oscillator, if it is correct it should work. Be careful there are many formats to chose from. The Intel hex record and the Motorola S record are examples. As you become more experienced you can do it on the fly with software. There are many hex converters on line to help you get started with the strings.  This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil
This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

Go Up