complex stroke erste version
This commit is contained in:
parent
0813bc740d
commit
a4e4d0ef55
8 changed files with 192 additions and 171 deletions
22
requests.cpp
22
requests.cpp
|
@ -71,3 +71,25 @@ void rqAnalogRead()
|
|||
uint16_t value = adu.getValue(channel);
|
||||
usart.writeInt(value);
|
||||
}
|
||||
|
||||
void rqAdcDacStroke()
|
||||
{
|
||||
int16_t start = static_cast<int16_t>(usart.readInt());
|
||||
int16_t delta = static_cast<int16_t>(usart.readInt());
|
||||
int16_t count = static_cast<int16_t>(usart.readInt());
|
||||
|
||||
usart.writeByte(USART::MSG_OK);
|
||||
|
||||
count *= delta;
|
||||
|
||||
for(int16_t i = start; i != count; i += delta)
|
||||
{
|
||||
dac0.setValue(i);
|
||||
uint16_t a = adu.getValue(0);
|
||||
uint16_t b = adu.getValue(1);
|
||||
usart.writeInt(a);
|
||||
usart.writeInt(b);
|
||||
}
|
||||
|
||||
usart.writeByte(USART::MSG_OK);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue