Skip to content

Instantly share code, notes, and snippets.

@anoken
Last active January 12, 2020 08:27
Show Gist options
  • Save anoken/700d19493fffe368fdb683e5979d4290 to your computer and use it in GitHub Desktop.
Save anoken/700d19493fffe368fdb683e5979d4290 to your computer and use it in GitHub Desktop.
Maixduino_K210toESP32_UART
#include <Arduino.h>
#include <Wire.h>
#include <SPI.h>
HardwareSerial serial_ext(2);
void setup() {
Serial.begin(115200);
serial_ext.begin(115200, SERIAL_8N1, 1, 3);
}
void loop() {
if ( serial_ext.available() > 0 ) {
String str = serial_ext.readStringUntil('\n');
Serial.println(str);
}
vTaskDelay(10 / portTICK_RATE_MS);
}
#include <Arduino.h>
#include <Wire.h>
#include <SPI.h>
HardwareSerial serial_ext(2);
void setup() {
Serial.begin(115200);
serial_ext.begin(115200, SERIAL_8N1, 1, 3);
}
void loop() {
int n = serial_ext.write("hello");
vTaskDelay(10 / portTICK_RATE_MS);
}
import network
from machine import SPI
from Maix import GPIO
from fpioa_manager import fm, board_info
import utime
from machine import UART
fm.register(6, fm.fpioa.UART2_TX, force=True)
fm.register(7, fm.fpioa.UART2_RX, force=True)
uart_Port = UART(UART.UART2, 115200,8,0,0, timeout=1000, read_buf_len= 4096)
i = 0
while i<20:
a=uart_Port.readline()
print("in",a)
i=i+1
import network
from machine import SPI
from Maix import GPIO
from fpioa_manager import fm, board_info
import utime
from machine import UART
fm.register(6, fm.fpioa.UART2_TX, force=True)
fm.register(7, fm.fpioa.UART2_RX, force=True)
uart_Port = UART(UART.UART2, 115200,8,0,0, timeout=1000, read_buf_len= 4096)
i = 0
while i<20:
uart_Port.write("test\n")
i=i+1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment