From 9f19be3a03f96411ab4e714464bdfefb0d1d061e Mon Sep 17 00:00:00 2001 From: Nathanne Isip Date: Sat, 20 Apr 2024 20:50:39 +0800 Subject: [PATCH] Set/get command for output neurons via UART. --- main.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/main.go b/main.go index 52fd115..2e32e87 100644 --- a/main.go +++ b/main.go @@ -143,6 +143,20 @@ func main() { } break + case N2CMU_SET_OUTPUT_NEURON: + for i := 0; i < int(network.OutputCount); i++ { + network.OutputNeuron[i] = uart.ReadFloat32() + } + + uart.WriteOk() + break + + case N2CMU_GET_OUTPUT_NEURON: + for i := 0; i < int(network.OutputCount); i++ { + uart.WriteFloat32(network.OutputNeuron[i]) + } + break + case N2CMU_SET_EPOCH_COUNT: epoch = uart.ReadUint16() break