Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. wave display

wave display

Scheduled Pinned Locked Moved C / C++ / MFC
questiondata-structures
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zhenyuanwu
    wrote on last edited by
    #1

    how can I display the data that I get from the USB2.0 port? The data from the USB port continuously is in the "int buffer[1000];" I would like to use the PolyLineto(pt,1000) function to draw the line ; pt is defined as CPoint pt[1000], for(int i=0;i<1000;i++) { pt[i].x=i; pt[i].y=buffer[i]; } if I use the "pt[i].y=buffer[i]; " sentence ,every time the CPU will do an extra copy work, it will waste the CPU time. Are there any good methords that I don't need to copy the buffer data to the pt[i].y array? thanks zhenyuanwu.

    H 1 Reply Last reply
    0
    • Z zhenyuanwu

      how can I display the data that I get from the USB2.0 port? The data from the USB port continuously is in the "int buffer[1000];" I would like to use the PolyLineto(pt,1000) function to draw the line ; pt is defined as CPoint pt[1000], for(int i=0;i<1000;i++) { pt[i].x=i; pt[i].y=buffer[i]; } if I use the "pt[i].y=buffer[i]; " sentence ,every time the CPU will do an extra copy work, it will waste the CPU time. Are there any good methords that I don't need to copy the buffer data to the pt[i].y array? thanks zhenyuanwu.

      H Offline
      H Offline
      hasansheik
      wrote on last edited by
      #2

      hi, Use memcpy fucntion it will copy the whole buffer at a shot. all the best Hasan. hasansheik@yahoo.co.in hasansheik@lycos.com

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups