filmov
tv
Flutter OTG with Raspberry Pi Pico, source in the description

Показать описание
#flutter
#flutterotg
#pico
#picoflutter
#picoflutterotg
replace _GT_ with greater than symbol
replace _LT_ with less than symbol
youtube don't like angle brackets
flutter program
// plug the pico in the otg cable before starting flutter app
import 'dart:async';
import 'dart:typed_data';
void main() =_GT_ runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() =_GT_ _MyAppState();}
class _MyAppState extends State_LT_MyApp_GT_ {
var _port;
@override
void connect() async {
_port = await devices[0].create();
115200, UsbPort.DATABITS_8, UsbPort.STOPBITS_1, UsbPort.PARITY_NONE);}
@override
void dispose() {
if ( _port != null ) {_port = null;}}
@override
void initState() {
connect();}
@override Widget build(BuildContext bc){
return MaterialApp(home: Scaffold(appBar: AppBar(title: Text('usb serial demo')),
body: Center(child:Column(children:[
SizedBox(height:20),
Text('plugin pico before starting this app'),
SizedBox(height:50),
SizedBox(height:50),
SizedBox(height:50),
]))));}
Widget button(text, data, c){
return ElevatedButton(child: Text(text),
// board Raspberry Pi Pico
#include _LT_NeoPixelConnect.h_GT_
NeoPixelConnect p(16, 1, pio0, 0);
void setup() {
void loop() {
switch(ch){
}}}
#flutterotg
#pico
#picoflutter
#picoflutterotg
replace _GT_ with greater than symbol
replace _LT_ with less than symbol
youtube don't like angle brackets
flutter program
// plug the pico in the otg cable before starting flutter app
import 'dart:async';
import 'dart:typed_data';
void main() =_GT_ runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() =_GT_ _MyAppState();}
class _MyAppState extends State_LT_MyApp_GT_ {
var _port;
@override
void connect() async {
_port = await devices[0].create();
115200, UsbPort.DATABITS_8, UsbPort.STOPBITS_1, UsbPort.PARITY_NONE);}
@override
void dispose() {
if ( _port != null ) {_port = null;}}
@override
void initState() {
connect();}
@override Widget build(BuildContext bc){
return MaterialApp(home: Scaffold(appBar: AppBar(title: Text('usb serial demo')),
body: Center(child:Column(children:[
SizedBox(height:20),
Text('plugin pico before starting this app'),
SizedBox(height:50),
SizedBox(height:50),
SizedBox(height:50),
]))));}
Widget button(text, data, c){
return ElevatedButton(child: Text(text),
// board Raspberry Pi Pico
#include _LT_NeoPixelConnect.h_GT_
NeoPixelConnect p(16, 1, pio0, 0);
void setup() {
void loop() {
switch(ch){
}}}
Комментарии