Go Down

Topic: String numeric output with V-USB HID (Read 30617 times) previous topic - next topic


How is it possible to use the millis() function, because of timer0 is disabled?

We write our own:

Code: [Select]

void delayMs(unsigned int ms) {    // Safe delay helper function
  for (int i = 0; i < ms; i++) {


PS: I have not gotten this rolled into the forum yet, but it is way cool.... HID bidirectional and it does not enumerate as a HID keyboard... the downside is that you do have to install the avrisp INF under Windows.


Oke, this is an delay-function.
But I want to write the time in excel since beginning of the program.
So we can draw such as a time-temperature chart.

Or I don't understand it well?

Thanks for hint, but the installation of a driver is just what we don't want.



But I want to write the time in excel since beginning of the program.

Take a look at how to send a string over USB:
Code: [Select]

sOut = "UNO 328P EXAMPLE - RAY BURNETTE C20121210";

If you have implemented RTC hardware, it is simply a matter of updating the variables from the RTC, concatenating date/time into a string, and using KeyStrokeAlpNum(sTimeDate) to send it over USB into Excel.

The Excel worksheet will require editing because you will be adding additional information.

You can also write an Excel macro (or VBA) with a keyboard shortcut so that the Excel document will time-date stamp, then you simply send the keyboard codes for that macro over the V-USB connection and Excel will oblige.  Looking at the existing output, there is currently a blank line being sent so you could put your time/date stamp in the blank cell (Ex: A5, A13, A21, etc.)

If you want to just send the millisecond count from the time the Arduino was last Reset/PoweredOn, then the magic for doing that is similar to:
Code: [Select]

    for (int i = 0; i < 6; i++){
      // read the analog in value:
      sensorValue = analogRead( i );
      // Label the value
      sOut = "ANALOG";
      // String the characters together
      sOut.concat(" ");
      // spool the combined strings


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131