I Have a Ultrasonic driver board that is activated with a momentary switch acting as a toggle (click turns it on - click again turns it off).
As the main chip has no writing on it, how would I probe it to find out what pins do what and interface a Arduino with it?
What i know so far:
The board has heavy debouncing on the button so controlling it by putting a transistor switch over the button will not work, as i need to switch this on and off in 100ms intervals. The debounce seems to be about 1000ms
Short press toggles PWM output. Long press toggles LED's on the back of the board.
With a multimeter I have found the pin that reads the button, +5V and Ground
My Goal is to control this board with digitalWrite() from a arduino or a transistor switch controlled by a arduino.
#include <SoftwareSerial.h>
SoftwareSerial HM10(2, 3); // RX = 2, TX = 3
char appData;
String inData = "";
void setup()
{
Serial.begin(9600);
Serial.println("HM10 serial started at 9600");
HM10.begin(9600); // set HM10 serial at 9600 baud rate
pinMode(5, OUTPUT); // onboard LED
digitalWrite(5, LOW); // switch OFF LED
}
void loop()
{
HM10.listen(); // listen the HM10 port
while (HM10.available() > 0) { // if HM10 sends something then read
appData = HM10.read();
inData = String(appData); // save the data in string format
Serial.write(appData);
}
if (Serial.available()) { // Read user input if available.
delay(10);
HM10.write(Serial.read());
}
if ( inData == "a") {
Serial.println("Power off");
digitalWrite(5, LOW); // switch off
}
if ( inData == "b") {
Serial.println("Power on");
digitalWrite(5, HIGH); // switch On
}
}