Skip to content

Instantly share code, notes, and snippets.

View winhtut's full-sized avatar
🎯
Focusing

WinHtut winhtut

🎯
Focusing
View GitHub Profile
int adc_max = 0; // Variable to store the maximum sensor value
int adc_min = 1023; // Variable to store the minimum sensor value
long tiempo_init; // Variable to store the initial time
void setup() {
Serial.begin(115200); // Initialize the serial communication
tiempo_init = millis(); // Get the current time in milliseconds
}
void loop() {
// Calibration values obtained from the sketch: volt_ac_cal
int adc_max = 760; // Maximum sensor value during calibration
int adc_min = 261; // Minimum sensor value during calibration
float volt_multi = 231; // RMS voltage obtained from a multimeter
float volt_multi_p; // Peak voltage
float volt_multi_n; // Negative peak voltage
void setup() {
Serial.begin(115200);
// Checking if a binary tree is a complete binary tree in C++
#include <iostream>
using namespace std;
struct Node {
int key;
struct Node *left, *right;
};
// Checking if a binary tree is a full binary tree in C++
#include <iostream>
using namespace std;
struct Node {
int key;
struct Node *left, *right;
};
#include <iostream>
using namespace std;
struct Node {
int data;
struct Node *left, *right;
Node(int data) {
this->data = data;
left = right = NULL;
}
@winhtut
winhtut / winhtut.ino
Created March 19, 2020 12:24
BluetoothAndCarManyServo
#include<Servo.h>
#include<SoftwareSerial.h>
SoftwareSerial bt(6,7);
Servo myServo;
Servo myServo1;
void setup() {
Serial.begin(9600);
bt.begin(9600);
myServo.attach(9);
@winhtut
winhtut / dcspeed.ino
Created March 14, 2020 07:09
dcmotorSpeedControlWinHtut
const int IN1 = 7;
const int IN2 = 6;
const int ENA = 9;
const int ENB = 3;
void setup() {
pinMode (IN1, OUTPUT);
pinMode (IN2, OUTPUT);
@winhtut
winhtut / linkedlinst.cpp
Last active February 11, 2020 05:14
DSA
testing for sutdents
@winhtut
winhtut / tree.cpp
Created January 29, 2020 08:22
Tree
#include<iostream>
using namespace std;
struct node {
int data;
struct node* left;
struct node* right;
};
struct node* createNode(int val) {
struct node* temp = (struct node*)malloc(sizeof(struct node));
@winhtut
winhtut / 1 . linearSerach.cpp
Last active January 3, 2020 06:24
DataStructureAndAlgorithms by Win Htut
/* C++ Program - Linear Search */
#include<iostream>
#include<conio.h>
void main()
{
int arr[10], i, num, n, c=0, pos;
cout<<"Enter the array size : ";
cin>>n;