I am using a pair of HM-10 BLE serial modules on a pair of UNO boards. One configured as a master and one slave.
On the master side I have several potentiometers on ADC's. The ADCs will be in a tight loop sending out serial data.
On the slave side the I/O are connected to several hobby servos (standard 1ms to 2ms pulsewidth @ 16.7ms.
refresh).
What is the best way to set up the slave side code to update the servo positions as they come in from the master potentiometer values. I need this to be responsive since i am going to use it for a RC truck I am building.
PS...arduino has servo commands, what is the equivalent in GCB?
Thanks,
Nick
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have not used the HM-10BLE modules. Presumably there is some sort of AT command set that is available? That might be it for starters to get things going quickly. So if they have a USART out, then it would be easy to use an interrupt on receivefor the Slave unit to receive the ADC values, then write them to the PWM duty cycle registers. There are a few examples to be found about using a circular buffer to manage the data coming in from the USART.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am using a pair of HM-10 BLE serial modules on a pair of UNO boards. One configured as a master and one slave.
On the master side I have several potentiometers on ADC's. The ADCs will be in a tight loop sending out serial data.
On the slave side the I/O are connected to several hobby servos (standard 1ms to 2ms pulsewidth @ 16.7ms.
refresh).
What is the best way to set up the slave side code to update the servo positions as they come in from the master potentiometer values. I need this to be responsive since i am going to use it for a RC truck I am building.
PS...arduino has servo commands, what is the equivalent in GCB?
Thanks,
Nick
There is a guide here https://sourceforge.net/p/gcbasic/discussion/projects%26guides/thread/66153766/#ae47
that should get you going by using a hardware PWM with servo update for the mega328.
I have not used the HM-10BLE modules. Presumably there is some sort of AT command set that is available? That might be it for starters to get things going quickly. So if they have a USART out, then it would be easy to use an interrupt on receivefor the Slave unit to receive the ADC values, then write them to the PWM duty cycle registers. There are a few examples to be found about using a circular buffer to manage the data coming in from the USART.
HI Kent,
I will give it a try. Traveling, oh i so wish I had uninterrupted time LOL.