Another idea for you: how is controlling dimmers not unlike hobby servos? They both have a 50 hz repeat rate for you in the UK. You may be able to control your lights with 4us resolution by adapting the PWMservo...
What kind of Timer interrupt are you using? Usually a timer interrupt is started in your setup code and started only once. You are calling begin on every interrupt which would only be needed if the Timer works as a...
At first glance this project suggests one would use the C bitwise operators, &-AND, |-OR, ^-XOR but the way you have stored your data prevents this. But if all your inputs were kept in the BIT 0 position you could...
You should be fine with using just one serial port keeping in mind that the SBUS uses inverted serial, although just to confuse things some flight controllers provide both an inverted input and non-inverted input. ...
Are you expecting data back and maybe used one of the blocking serial read commands.
https://www.arduino.cc/reference/en/language/functions/communication/serial/settimeout/
I calculate that 32 bytes at 115k baud would take 2.7 ms even if there were no buffering at all for the transmit bytes, nowhere near 400 ms.
And 32 bytes at 19.2k baud would take 16.6 ms, nowhere near the increase of...
You could put a FET like a BS170 between the Teensy and your device under control. The FET when off will have a very high resistance. This will reverse the logic in your program as the FET will invert the signal.
...
I suggest you look in ......hardware/Teensy/avr/cores/Teensy3/Serial1.c to see if it was hacked to support the pin numbers 98,99. Otherwise calling Serial1.begin seems to set up the baud rate but not any pins.
My...
My only other idea is to follow the setting of the bits in the SPI command register with the pinMode setting as KurtE suggested.
SPI0_C2 |= ( 1<<SPI_C2_SPC0 | 1<<SPI_C2_BIDIROE );
pinMode(12, INPUT_PULLUP);
Sorry, (and there is still a chance I am looking at the incorrect reference doc) but it seems those bits are not defined for the user ( and it is SPC0 zero not O as I previously wrote )
but the register is defined. ...
The reference manual ( hopefully I am reading the correct one, KL26 sub-family ) seems to indicate you could regain use of the MISO pin by setting some bits in control register 2.
SPI0_C2 |= 1<<SPCO + 1<<BIDIROE;
uint8_t readI2C()
{
switch(syncCom)
{
case 0:
byteToread = Wire.available();
if (byteToread >= requestBytes)
{
Serial.println(requestBytes);
for (uint8_t k = 0; k <...
I would see this working like this: you set the RV-3028 to generate a 1 second interrupt. In servicing the interrupt you read the time via I2C and reset your elapsed micros variable to zero. You now have your...
You could use an elapsed micros variable. You would reset the variable to zero on each change of the second on your external clock.
https://www.pjrc.com/teensy/td_timing_elaspedMillis.html
PWM is built in with the analogWrite function so I am not sure you would need a library. You also have full control of the resolution and frequency as this page explains: https://www.pjrc.com/teensy/td_pulse.html