By understanding the different types of switches and their uses, we can better understand how to use them in our projects.Are you a fan of The Great Gatsby? Do you just adore the Roaring Twenties, with its flapper dresses, extra-long cigarette holders, and swing dancing? Are you attracted to clean lines and bold design? Chances are you’re responding to the ethos of Art Deco design. Switches have a range of different uses, from controlling electric circuits to being used as user inputs. We also learned how to use evive’s slide switches with Arduino IDE and display the state of the switch on the TFT Screen. In this lesson, we learned about the different kinds of switches, with a focus on SPST and SPDT switches. Tft.setTextColor(ST7735_GREEN, ST7735_BLACK) check if the slideswitch is in state 2. Tft.setTextColor(ST7735_BLUE, ST7735_BLACK) check if the slideswitch is in state 1. Tft.setTextColor(ST7735_WHITE, ST7735_BLACK) read the state of the pushbutton value: initialize the slideswitch pins as an input: Tft_init(INITR_GREENTAB) // initialize a ST7735S chip, black tab Int buttonState2 = 0 // variable for reading the pushbutton pin 2 status Int buttonState1 = 0 // variable for reading the pushbutton pin 1 status SLIDESW2_D2 for digital pin 43(Slide switch 2 in down direction) SLIDESW2_D1 for digital pin 42 (Slide switch 2 in upper direction) SLIDESW1_D2 for digital pin 41 (Slide switch 1 in down direction) SLIDESW1_D1 for digital pin 40 (Slide switch 1 in upper direction) Use following keys words for accessing digital pins connected to slide switch: This code demonstrates how to use slide switch in Aruino IDE and display state on TFT Screen. Flow Chartīelow is the flow chart on which the sketch will be based: In this example, we will read the state of evive’s slide switch 1 and display it on the TFT Screen. When it slides down, pin 41 is high while both are low when the switch is in the middle. Slide switch 2 is connected to pins 42 and 43, and works in a similar manner as slide switch 1.Įxample: Displaying the state of evive’s Slide Switch on TFT This means that when the switch is slid up, pin 40 is high. SPDTs have three terminals: one common pin and two pins which for connection to the common.Įvive has two inbuilt 3-way slide switches. Slide switch 1 is connected to Arduino pins 40 and 41, both active high. SPST switches require two terminals only. They’re also a very common form of momentary switches. SPST switches are perfect for on-off switching. The switch will either be closed or completely disconnected. Switches are commonly are defined as single-pole, single-throw, such as a tactile switch, and single-pole, double-throw, such as a slide switch. if a switch has two throws, each circuit (pole) in the switch can be connected to one of two terminals. Throw: A switch’s throw-count defines how many different positions each of the switch’s poles can be connected to.switch with one pole, can control only one single circuit. Pole: The number of poles on a switch defines how many separate circuits the switch can control.While learning about switches, there are two important concepts that one should look into:
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |