Kullanıcı1233
Kıdemli Üye
- 19 Tem 2011
- 4,371
- 12
In this topic, i tried to show you guys how to use laser with button. You can watch the following video. I will also share the source code.
[ame]https://www.youtube.com/watch?v=PFNAmCylT2o[/ame]
#include <Arduino.h>
#include <Wire.h>
#include <SoftwareSerial.h>
double angle_rad = PI/180.0;
double angle_deg = 180.0/PI;
v0id setup(){
pinMode(2,INPUT);
pinMode(8,OUTPUT);
}
v0id loop(){
if(((digitalRead(2))==(1))){
digitalWrite(8,0);
}else{
digitalWrite(8,1);
}
_loop();
}
v0id _delay(float seconds){
long endTime = millis() + seconds * 1000;
while(millis() < endTime)_loop();
}
v0id _loop(){
}
PS change '0' to 'o' in 'v0id'
Original: https://www.turkhackteam.org/elektr...-arduino-buton-ile-lazer-kullanimi-rozzz.html
Translator: @R4V3N