The wiring required for our smoking cat ghost
The first step is to connect all the electronic components as seen on the circuit diagrams.
Our 3d model printed
We print the model in 3D from MIKEKAVOURAS, you can download it here https://www.thingiverse.com/thing:4635017. We printed it 311% bigger than the original in order for the electronic components to fit in.
Code
Code for our smoking cat ghost using Portenta H7 LITE and a piezoelectric disc.
C/C++
const int PIRPin = 2; const int LED1= 9; // pin para el LED const int LED2 = 8; void setup() { pinMode(LED1, OUTPUT); pinMode(LED2, OUTPUT); pinMode(A3, OUTPUT);// Set A5 as OUTPUT } void loop() { digitalWrite(A3, HIGH); // atomize digitalWrite(LED1, HIGH); // turn the LED on (HIGH is the voltage level) digitalWrite(LED2, HIGH); // turn the LED on (HIGH is the voltage level) delay(10000); // wait for 10 seconds //digitalWrite(A3, LOW); // atomization stopped //delay(1000); }