6. Case 04:Smart Desk Lamp

6.1. Purpose


  • To build a desk lamp.

../../_images/Ringbit_Bricks_Pack_case_en_04_01.png

6.2. Materials


../../_images/Ringbit_Bricks_Pack_case_en_04_02.png

6.3. Background Knowledge


6.4. Bricks build-up


../../_images/Ringbit_Bricks_Pack_step_04_01.png

../../_images/Ringbit_Bricks_Pack_step_04_02.png

../../_images/Ringbit_Bricks_Pack_step_04_03.png

../../_images/Ringbit_Bricks_Pack_step_04_04.png

../../_images/Ringbit_Bricks_Pack_step_04_05.png

../../_images/Ringbit_Bricks_Pack_step_04_06.png

../../_images/Ringbit_Bricks_Pack_step_04_07.png

../../_images/Ringbit_Bricks_Pack_step_04_08.png

../../_images/Ringbit_Bricks_Pack_step_04_09.png

../../_images/Ringbit_Bricks_Pack_step_04_10.png

../../_images/Ringbit_Bricks_Pack_step_04_11.png

../../_images/Ringbit_Bricks_Pack_step_04_12.png

../../_images/Ringbit_Bricks_Pack_step_04_13.png

../../_images/Ringbit_Bricks_Pack_step_04_14.png

../../_images/Ringbit_Bricks_Pack_step_04_15.png

../../_images/Ringbit_Bricks_Pack_step_04_16.png

../../_images/Ringbit_Bricks_Pack_step_04_17.png

A detailed assembly instruction can be downloaded via the below links: Githubdownload

6.5. Software


MicroSoftmakecode

6.6. Code


Step 1

Click “Advanced” in the MakeCode drawer to see more choices.

../../_images/Ringbit_Bricks_Pack_case_en_04_03.png

In order to programme for the Ring:bit Bricks Pack, we need to add an extension. Click “Extensions” at the bottom of the drawer. Search “Ringbit” in the dialogue box to download it.

../../_images/Ringbit_Bricks_Pack_case_en_04_04.png

Note: If you met a tip indicating codebase will be deleted due to incompatibility, you may continue as the tips tell or build a new project.

Step 2

Drag the set strip to NeoPixel at pin with led as to on start, set the pin at P0 port. Initialize the strip in 10 LEDs and in RGB(GRB format).

../../_images/Ringbit_Bricks_Pack_case_en_04_05.png

Step 3

Judge the returned value from “light level” in “forever” block, if the value is less than 10, set the strip color in white; if the value is over 15, set the strip color in black.

../../_images/Ringbit_Bricks_Pack_case_en_04_06.png

Code

Link: https://makecode.microbit.org/_3972aULrT1Dz

You can also download it directly below:

### Result --- It lights on automatically while the surrounding light is low and lights off when the returned value is higher than your set point.

6.7. Exploration


6.8. FAQ


6.9. Relevant File


In 1854, the German watchmaker Henry Gobert immigrated to the United States made the first practical electric lamp with a carbonized bamboo wire placed in a vacuum glass bottle, which lasted for 400 hours. But he didn’t apply for a patent in time.

In 1860, the Englishman Joseph Swan also made a carbon wire electric lamp, but he failed to obtain a good vacuum environment to keep the carbon wire working for a long time. It was not until 1878 that vacuum technology in the United Kingdom developed to a desirable level, and he invented a light bulb powered by carbon wire under vacuum, and obtained a British patent. Swan’s own house was Britain’s first private house with electric lighting.

In 1874, two Canadian electrical technicians applied for a patent for an electric lamp: nitrogen was filled under a glass bulb to emit light with a powered carbon rod, but they did not have enough financial resources to continue to perfect the invention. After they sold the patent to Edison, he tried to improve the filament, in 1880, a carbonized bamboo filament lamp that could last for 1,200 hours was finally manufactured.

However, the US Patent Office ruled that Edison’s carbon filament incandescent invention fell behind, and the patent was invalid. After years of litigation, Henry Goebbels won the patent, and Edison finally bought the patent from Goebbels’ widow. In the United Kingdom, Swan sued Edison for patent infringement, and later settled out of court, setting up a joint company in the United Kingdom in 1883.

Swan later sold his equity and patents to Edison.In the early 20th century, carbonized filaments were replaced by tungsten filaments, and tungsten filament incandescent lamps are still in use at present. In 1938, fluorescent lights were born. In 1998, white LED lights came out.