Understanding Boolean Data Types and Using the Boolean NOT (!) operator to Switch Arduino Pin States

🤩 How much Arduino can you learn in 7 Days? 👇
bit.ly/7_Day_Arduino_Challenge
**If you like this, I think you'll like the premium Arduino training we offer. Check it out here** bit.ly/3nSBPUs

Пікірлер: 36

  • @programmingelectronics
    @programmingelectronics3 жыл бұрын

    ****If you like this, I think you'll like the premium Arduino training we offer. You can check it out here**** bit.ly/3lHyzcB

  • @ishsiriram8286
    @ishsiriram82863 жыл бұрын

    Thank you for your explanation, makes the bool function much more clear to me. Ish - South Africa

  • @daywidjc
    @daywidjc9 жыл бұрын

    It's so much easier learning this material in bite sized pieces, Another video well done. Thanks Michael.

  • @programmingelectronics

    @programmingelectronics

    9 жыл бұрын

    David Carr Thanks David! I am glad these can help.

  • @JahanZeb1976
    @JahanZeb19769 жыл бұрын

    Excellent video on basic programming concept! Great work. Regards,

  • @programmingelectronics

    @programmingelectronics

    9 жыл бұрын

    LearningZone Thanks a ton! I appreciate the kind words.

  • @joshuapitong899
    @joshuapitong899 Жыл бұрын

    Always a great help. Thank you 🙌

  • @programmingelectronics

    @programmingelectronics

    Жыл бұрын

    Thanks so much!!!

  • @MrVishalarwade
    @MrVishalarwade Жыл бұрын

    Excellent !! Thank you sooooo much 🙏🏻

  • @programmingelectronics

    @programmingelectronics

    Жыл бұрын

    Glad it was helpful!

  • @stig3081
    @stig30816 жыл бұрын

    Thx man!

  • @015digambarsharma4
    @015digambarsharma44 жыл бұрын

    Thanks Man. It was really confusing.

  • @TGFMusic
    @TGFMusic4 жыл бұрын

    Holy hell this was almost 6 years ago.. so i expect no reply but, why on earth would I want to do all of this instead of making "int" or something else, and after the delay simply putting a "!" with the "int" ... basically what makes boolean any different than another variable? Or is it just because it can literally only be on or off so it is easier to understand for simple tasks?

  • @parallaxgenesis365
    @parallaxgenesis3658 жыл бұрын

    sir, how can you make a blink proportional to the serial data from processing? what i mean is, i wanted to have just a single blink per pixel of x axis in processing on each time i move. what i wanted to do is, i wanted to make the blink function of my led like of that of servo that it has corresponding steps, but instead if steps, i wanted it to have a blink per pixel i move with my gui in processing. but i dont know how to set a "map" like for example from 0pixel in x axis o a maximum of 366pixels is from 0 blink state of led to 366. i hope you get what i mean. pls help me figure this out ^_^

  • @sauravprashar
    @sauravprashar6 жыл бұрын

    Got it and we can also make a simple home automation system

  • @qwezxc23456
    @qwezxc234568 жыл бұрын

    Thanks sir.

  • @syazwiazharsarkawi4433
    @syazwiazharsarkawi44338 жыл бұрын

    hai sir, can u pardon me to create one coding for our final project. my project about the fluorescent lamp. we use arduino uno. in this case, i need to create using boolean because my project is connect via webpage and actual switch. the probably right now is if i use both function, my relay got burn if i switch on lamp using webpage and switch off using actual switch. i need u response asap. sorry if my english very poor

  • @cristiansanta4250
    @cristiansanta42502 жыл бұрын

    This video is really helpfull thank you so much...

  • @programmingelectronics

    @programmingelectronics

    2 жыл бұрын

    Glad it was helpful!

  • @sanvenganza77
    @sanvenganza776 жыл бұрын

    why cannot set boolean in arduino schedule? arduino dont understand that comand.

  • @wonderwang1585
    @wonderwang15853 жыл бұрын

    When you re using not-boolean why you not use delay?

  • @gitagoswami6878
    @gitagoswami68784 жыл бұрын

    What about Strings??? are they true or false??

  • @attalaw36
    @attalaw364 жыл бұрын

    thanks

  • @shereifwagdi7558
    @shereifwagdi75584 жыл бұрын

    Thanks!

  • @programmingelectronics

    @programmingelectronics

    4 жыл бұрын

    You bet! Thanks for the note!

  • @tirthrajgandhakwala6201
    @tirthrajgandhakwala62017 ай бұрын

    Awesome!!

  • @programmingelectronics

    @programmingelectronics

    7 ай бұрын

    Thank you! Cheers!

  • @taranagnew436
    @taranagnew4366 жыл бұрын

    i got a LCD keypad shield on top of my arduino and i want to be able to press the select button on the LCD keypad shield to generate random numbers, the problem i'm having is "when i go press the select button, nothen happens, plz help and here is my code #include #include // this is factory config shield initialisation LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // initialise the keypad DFR_LCD_Keypad keypad(A0, &lcd); int lcd_key = 0; int abc_key_in; #define btnSELECT 4 int read_LCD_buttons; int diceOne; int diceTwo; define btnSELECT 4 int read_LCD_buttons() { abc_key_in = analogRead(0); if (abc_key_in void setup() { lcd.begin(16, 2); lcd.setCursor(0, 0); lcd.print("Press to dice"); pinMode (A0, INPUT); } void loop() { lcd_key = read_LCD_buttons(); switch (lcd_key) { case btnSELECT{ diceOne = random(1, 7); diceTwo = random(1, 7); if (diceOne + diceTwo == 7) { lcd.clear(); lcd.setCursor(7, 0); lcd.print("7"); lcd.setCursor(3, 1); lcd.print("The pirate"); if (diceOne + diceTwo == 5, 4, 3, 2, 6 ) { lcd.clear(); lcd.setCursor(7, 0); lcd.print("5,4,3,2,6"); if (diceOne + diceTwo == 3,2,1,5,4,6) { lcd.clear(); lcd.setCursor(7, 0); lcd.print("fish"); } } } } }

  • @siddharthsinghrajawat3401
    @siddharthsinghrajawat34018 жыл бұрын

    Hello sir,i like your channel and it helped me to get started with arduino but im stuck at this Problem : my aim : i want to make a ldr to on and off an LEd (like a TV). what i coded : int led = 9; int ldr = A0; const int on = 700; const int off = 600; void setup() { pinMode(led,OUTPUT); pinMode(ldr,INPUT); Serial.begin(9600); } void loop() { int value = analogRead(ldr); Serial.println(value); switch (value) { case on : digitalWrite(led,HIGH); break; case off: digitalWrite(led,LOW); break; default: break; } } my obervation with ldr = max value 1023 and min value 500 at A0 Now my problem is "data type" as we all know ldr value will change i want to know that is there any data type which stores value from one range to another like (ex. 500-700 for ON ) and (700-1023 for off) .. or this is not possible with LDR it is still working though but i have to be fast as value must be equal to what i have specified (const int on and const int off ) . TV uses IR which have specific values but still its chellenging to do it with ldr

  • @programmingelectronics

    @programmingelectronics

    8 жыл бұрын

    +Siddharth Singh Rajawat Great question - you should check out this function, called map(), it might solve your problem. www.arduino.cc/en/Reference/Map Best of luck!

  • @Ahm.ad_Ali
    @Ahm.ad_Ali2 жыл бұрын

    Thanks

  • @programmingelectronics

    @programmingelectronics

    2 жыл бұрын

    Thanks a ton for watching!

  • @basimpsn
    @basimpsn9 жыл бұрын

    Enjoy your videos very entertaining (beating a dead horse lol) Question do I have to download a Boolean Library? because my IDE for my arduino due don't recognize this code.

  • @programmingelectronics

    @programmingelectronics

    9 жыл бұрын

    basimpsn You should have to download a library for using Boolean data types. Are you getting any specific errors when you compile the code?

  • @bdtech6400
    @bdtech64002 жыл бұрын

    Arduino titurial link my halp mi

  • @snaprollinpitts
    @snaprollinpitts9 жыл бұрын

    okay, the dead dog has been officially kicked! you should've had the horse bone fall apart and hit the floor. be careful, that kind of bouillon with water can cause cancer to an arduino board