Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!
Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.
Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!
Ad Blocking Detected
Please consider disabling your ad blocker for our website.
We rely on these ads to be able to run our website.
You can of course support us in other ways (see Support Us).
hi everyone, I'm a newbie with Arduino and in desperate need for help! I study industrial design and am working on a project where I want to have a little engine with a counterweight (like you find in electric toothbrushes, vibrators...) be controlled by the signals read by this ecg module: https://how2electronics.com/ecg-monitoring-with-ad8232-ecg-sensor-arduino/
both of those setups work fine for themselves, and since I had the manual and all the information it was easy even for me to get everything running. But since my knowledge doesn't go any further than that, I am a bit lost now. How do I have to connect the hardware, and how do I re-write the code to get it to work? I've been copy-pasting the codes on the websites posted above.
Hopefully this post describes well enough what I'm trying to do. I'd be happy to answer any more questions or show some pics of what I've got so far. Any help would be greatly appreciated!
Unfortunately, I have no experience with either. Looking at both projects though, I do not see a conflict in wiring - well, except for the potentiometer. You can leave that one out since you're using the ECG data instead.
Combining code (without modifying anything - and both functions work as before) should not be a problem either.
This could look something like this, where I presume you'd want the ECG data to be used as an input for the motor.
#define PWM 3
int pot;
int out;
void setup() {
// initialize the serial communication:
Serial.begin(9600);
pinMode(10, INPUT); // Setup for leads off detection LO +
pinMode(11, INPUT); // Setup for leads off detection LO -
pinMode(PWM,OUTPUT);
}
void loop() {
pot=analogRead(A0);
if((digitalRead(10) == 1)||(digitalRead(11) == 1)){
Serial.println('!');
} else{
// send the value of analog input 0:
Serial.println(pot);
}
out=map(pot,0,1023,0,255);
analogWrite(PWM,out);
delay(1); // may longer be needed
}
Note: I do not have any of these components and I have zero experience with these either. So the code is untested. But I'm confident this will get you close to what you may have had in mind. 😊
ReplyQuote
Like what you see and you'd like to help out?
The best way to help is of course by assisting others with their questions here in the forum, but you can also help us out in other ways:
Please consider disabling your ad blocker for our website.
We rely on these ads to be able to run our website.
You can of course support us in other ways (see Support Us).
Lazarus / FPC Lazarus / Free Pascal Compiler - A cross platform software development environment that show similarities with the good old Delphi.
HandBrake Great tool for ripping DVD's and converting video.
Lubuntu A Ubuntu variant aimed at being small and fast. Love it!
CleverSubmitter Submits your website for indexing with a truckload of search engines.
Down For Every One or Just Me? Checks if a website (URL) is up or down, for every one or just you ... Awesome to test when a link is not working.
Ubuntu Ubuntu is probably one of the most used Linux distro's out there. Very well supported and a great Linux distro
Links Page These and more of our favorite links can be found on the Links Page.
New Downloads
MiniWOL2 MacOS (64 bits Apple Silicon)Date: 2023-08-01 - Size: 1.2 MBminiWol is a simple, but effective application to send Wake On LAN to network devices. This is the signed 64 bit MacOS ARM (Apple Silicon) version.
ConnectMeNow4-v4.0.10-macOS-arm64.dmgDate: 2023-07-07 - Size: 2.6 MBVersion 4 of ConnectMeNow - A tool for more convenient mounting of network shares under macOS. This is the Apple Silicon version (not suitable for Intel).
ConnectMeNow4-v4.0.10-macOS-x86-64.dmgDate: 2023-07-07 - Size: 3 MBVersion 4 of ConnectMeNow - A tool for more convenient mounting of network shares under macOS. This is the Intel version which works on Intel and Apple Silicon Macs.
MovieScanner2-2.2.3-Windows-32bit-setup.exeDate: 2023-04-12 - Size: 18.6 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 32 bit Windows version.
MovieScanner2-2.2.2-Linux-GTK-64bits.tar.gzDate: 2023-04-11 - Size: 29.2 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 64 bit Linux version for GTK.
MovieScanner2-2.2.2-Linux-QT5-64bits.tar.gzDate: 2023-04-11 - Size: 29.1 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 64 bit Linux version for QT5.
Downloads Page Find these and more Downloads on the Downloads Page, where you will also find articles references, operating system requirements and categories.
Amazon Ads
Support us by doing your shopping at Amazon.com, either click the link, or click one of the links below …
You can also sponsor us through these Amazon offerings:
Please consider disabling your ad blocker for our website.We rely on these ads to be able to run our website.You can of course support us in other ways (see Support Us on the left).