Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
¿Cómo enviaría un archivo con Web Serial API?

Soy un novato total, recién comencé a investigar esto hoy. Tengo un Chromebook con la versión de Chrome 96.0.4664.111 (compilación oficial) (64 bits) y un raspberry pi pico en el que he cargado el gestor de arranque de Python (arrastrar y soltar). Estoy tratando de acceder al pico desde mi navegador en serie para cargar mi código fuente ya que no puedo instalar thawny en mi Chromebook. He ensamblado esta función de javascript que usa la API serial web para conectarse al pico.

 const filters = [ { usbVendorId: 0x2E8A, usbProductId: 0x0003 }, { usbVendorId: 0x2E8A, usbProductId: 0x0005 } ]; // Prompt user to select an Arduino Uno device. const port = await navigator.serial.requestPort({ filters }); const { usbProductId, usbVendorId } = port.getInfo(); // Wait for the serial port to open. await port.open({ baudRate: 9600 }); const textDecoder = new TextDecoderStream(); const readableStreamClosed = port.readable.pipeTo(textDecoder.writable); const reader = textDecoder.readable.getReader(); // Listen to data coming from the serial device. while (true) { const { value, done } = await reader.read(); if (done) { // Allow the serial port to be closed later. reader.releaseLock(); break; } // value is a Uint8Array. console.log(value); } // Listen to data coming from the serial device. while (true) { const { value, done } = await reader.read(); if (done) { // Allow the serial port to be closed later. reader.releaseLock(); break; } // value is a string. console.log(value); } const textEncoder = new TextEncoderStream(); const writableStreamClosed = textEncoder.readable.pipeTo(port.writable); const writer = textEncoder.writable.getWriter(); await writer.write("hi"); // Allow the serial port to be closed later. writer.releaseLock();

No puedo encontrar la manera de hacer que este programa cargue un archivo, realmente agradecería si alguien pudiera ayudarme. Por favor discúlpenme si no estoy siendo claro o soy extremadamente estúpido, soy completamente nuevo en esto y estoy muy cansado por el año nuevo de anoche. ¡Gracias!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

He encontrado una solución adecuada a mi pregunta, tinkerdoodle.cc.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!