objective: to detect a sensor such as ultra sonic - if it's disconnected - to indicate that.
code i use does not work.
can anyone suggest a way to detect a sensor?
boolean sensorDetected = digitalRead(trigPin);
if (sensorDetected = false) { // LOW or 0 OR you can compare the initial setting with current state
Serial.println(" Ultra Sound sensor not detected ");}
else
{
Serial.println(" Ultra Sound sensor detected ");
and the rest of code ...............
thanks.
COMMENT ON EASYVR module - just for those who presume it can simulate AI.
I was disappointed with this as it never goes near AI.
It cannot store a live diallogue or has any LEARNING capabilities.
AI means acquiring knowledge, skills, problem solving and above all store and LEARN.
it can have a dialogue with all stored commands and statement.
Looks like you have 2 problems;
First, test for equal is ==, single =is an assignment.
Second, you can’t necessarily test for presence of the sensor by reading an output pin, but If there is an external pull up, in might work. More details would be required.
Fix the first problem first and then the second might be ok.
Depending on how the sensor is wired, disconnecting it might leave the pin permanently in one state, or it might leave the pin floating. In neither case, will you be able to determine that the sensor is present, or not.
It comes with software to record/learn/store about 30 short commands.
even robotshop, the creators could not come up with an answer!
what do u mean by RECORD? pre-record or live?
pre-record is the basic functionality of easyVR.
we pre- record commands and we create responses.
what I meant was this - let us say you ask robot's name.
this we can pre-record and respond with say - 'my name is andy'
robots asks the person as an extension on above response; 'what is your name?'
again can be pre-recorded.
if the person says ; my name is tom' easyVR according to my understanding cannot
make the robot say 'nice to meet you tom' i. e. basically LIVE dialogue recording and storing.
pl explain how this could be achieved.
I thought of using a speaker(module) to store a response in EEPROM, but could not
find the right module. as u know speech to text via DECIMAL and reconverted
to DECIMAL to text and followed by speech.
I played with this module (shield actually) about two years ago, and I remember that the (robot) commands it came with were completely useless. As said, you can train/record your own commands with the EasyVR-Commander software. I used a 'wake-up' command first (to stop false actions), and then a range of actual commands (could be several branches/levels). I eventually, after weeks of trials, got to a 90%+ success rate.
Don't try to speak into the mic at close range. 1-3meters works fine. Use a natural/clear voice, and a 'dead'/quiet room (no echos).
You ofcourse need to train/record the commands also at that distance.
The module also has AFAIK some memory for pre-recorded (talkback) voice/sounds. Never played with that.
Leo..
I wonder whether you answered my question OR I did not comprehend what you said above.
do u mean LIVE chat? did u read my response to u? can it store the name of the person
if the person tells his/her name and respond 'HELLO JOHN' have u seen ROBIN app on android.
it can pick up the name and use it to address you back.
i am sorry if i am not getting through to you. i just cant explain simpler than this.
if you got this going great.
otherwise for me it has been a useless module/shield for all what I spent on and
the effort I put in. even robotshop said this module is unable to do what
i expected and its great to hear if u have got something going.
As said, don't expect it to be 'intelligent'.
You can only pre-record single commands, or maybe very short sentences. And the module can react to that, with the help of the Arduino software, to perform some action or to spit out a pre-recorded answer.
No commands/keywords hidden in a long sentence (like "Alexa" etc. can), and no live recording.
That said, WiFi enabled Arduino's can talk to those AI machines.