update for new microcontroller
Some checks failed
xiao_pet_tracker / semantic-pull-request (push) Failing after 0s
xiao_pet_tracker / build (push) Failing after 0s
xiao_pet_tracker / spell-check (push) Failing after 0s

This commit is contained in:
2025-06-27 16:37:38 +02:00
parent fe07da70f5
commit a16145e48c
14 changed files with 292 additions and 139 deletions

View File

@@ -67,7 +67,7 @@ class XiaoConnectorCubit extends Cubit<XiaoConnectorState> {
}
// set the xiao sense name
if (r.device.advName == 'Go Bluetooth') {
if (r.device.advName == 'Trouble Example') {
await FlutterBluePlus.stopScan();
device = r.device;
@@ -100,6 +100,27 @@ class XiaoConnectorCubit extends Cubit<XiaoConnectorState> {
);
}
Future<void> debug() async {
print('DEBUG!');
final accelService = _services
.where(
(s) => s.serviceUuid == Guid('19B10000-E8F2-537E-4F6C-D104768A1214'),
)
.first
.characteristics
.where(
(c) =>
c.characteristicUuid ==
Guid('19B10000-E8F2-537E-4F6C-D104768A1217'),
)
.first;
final data = await accelService.read();
print(data);
// accelService.onValueReceived((data) {});
}
Future<void> setCapturingOn() async {
final senseService = _services
.where(

View File

@@ -42,6 +42,15 @@ class ConnectedView extends StatelessWidget {
},
child: const Text('Disconnect'),
),
const SizedBox(
height: 48,
),
ElevatedButton(
onPressed: () {
context.read<XiaoConnectorCubit>().debug();
},
child: const Text('DEBUG'),
),
],
),
),