Friday, March 20, 2020

Start Programming C With raspberry Pi

Start Programming C With raspberry Pi This set of instructions wont suit everybody but Ill try to be as generic as possible. I installed the Debian Squeeze distribution, so the programming tutorials are based on that. Initially, Im starting off by compiling programs on the Raspi but given its relative slowness to any PC in the last ten years, its probably best to switch to developing on another PC and copying the executables over. Ill cover that in a future tutorial, but for now, its about compiling on the Raspi. Preparing for Developing The starting point is you have a Raspi with a working distribution. In my case, its Debian Squeeze which I burnt with instructions from the RPI Easy SD Card Setup. Make sure you bookmark the Wiki as its got tons of useful stuff. If your Raspi has booted and youve logged in (username pi, p/w raspberry) then type gcc - v at the command line. Youll see something like this: Using built-in specs.Target: arm-linux-gnueabiConfigured with: ../src/configure -v with-pkgversionDebian 4.4.5-8 with-bugurlfile:///usr/share/doc/gcc-4.4/README.Bugsenable-languagesc,c,fortran,objc,obj-c prefix/usr program-suffix-4.4 enable-shared enable-multiarch enable-linker-build-idwith-system-zlib libexecdir/usr/lib without-included-gettext enable-threadsposix with-gxx-include-dir/usr/include/c/4.4 libdir/usr/libenable-nls enable-clocalegnu enable-libstdcxx-debug enable-objc-gc disable-sjlj-exceptions enable-checkingrelease buildarm-linux-gnueabihostarm-linux-gnueabi targetarm-linux-gnueabiThread model: posixgcc version 4.4.5 (Debian 4.4.5-8) Install Samba One of the first things I did and recommend to you if you have a Windows PC on the same network as your Raspi is to install and setup Samba so you can access the Raspi. Then I issued this command: gcc -v l.txt To get the above listing into the file l.txt that I could view and copy on my Windows PC. Even if you are compiling on the Raspi, you can edit source code from your Windows box and compile on the Raspi. You cant just compile on your Windows box using say MinGW unless your gcc is configured to output ARM code. That can be done but lets learn to walk first and learn how to compile and run programs on the Raspi. Read up on Cygwin and MinGW. GUI or Terminal Ill assume that you are new to Linux, so apologies if you know it already. You can do most of the work from the Linux terminal ( command line). But it can be easier if you fire up the GUI (Graphical User Interface) to have a look around the file system. Type startx to do that. The mouse cursor will appear and you can click in the bottom left-hand corner (it looks like a mountain( to see the menus. Click on Accessories and run File Manager to let you view folders and files. You can close it down any time and return to the terminal by clicking the little red button with a white circle in the bottom right-hand corner. Then click on Logout to return to the command line. You may prefer to have the GUI open all the time. When you want a terminal click the bottom left button then click Other on the menu and Terminal. In the Terminal, you can close it by typing Exit or click the Windows like x in the top right-hand corner. Folders The Samba instructions on the Wiki tell you how to setup a public folder. Its probably best to do that. Your home folder (pi) will be readonly and you want to write to the public folder. I created a sub-folder in public called code and created the hello.c file listed below in it from my Windows PC. If you prefer to edit on the PI, it comes with a text editor called Nano. You can run it from the GUI on the other menu or from the terminal by typing sudo nanosudo nano hello.c The sudo elevates nano so it can write files with root access. You can run it just as nano, but in some folders that wont give you write access and you wont be able to save files so running things with sudo is usually best. Hello World Heres the code: #includeint main() {printf(Hello World\n);return 0;} Now type in gcc -o hello hello.c and it will compile in a second or two. Take a look at the files in the terminal by typing in ls -al and youll see a file listing like this: drwxrwxx 2 pi users 4096 Jun 22 22:19 .drwxrwxr-x 3 root users 4096 Jun 22 22:05 ..-rwxr-xr-x 1 pi pi 5163 Jun 22 22:15 hello-rw-rw 1 pi users 78 Jun 22 22:16 hello.c and type in ./hello to execute the compiled program and see Hello World. That completes the first of the programming in C on your Raspberry Pi tutorials. Into games programming in C? Try our free Games programming in C Tutorials.

Wednesday, March 4, 2020

35 Synonyms for Rain and Snow

35 Synonyms for Rain and Snow 35 Synonyms for Rain and Snow 35 Synonyms for Rain and Snow By Mark Nichol A rich variety of words and phrases are available to describe an array of wet weather conditions. Here are nearly three dozen terms for rain and snow events and their definitions (some accompanied by other meanings). 1. blizzard: a long, severe snowstorm (also, a sudden burst of something that comes in a large amount) 2. cloudburst: a brief, sudden, hard rain 3. condensation: conversion of vapor to a liquid or solid state, such as of cloud vapor into rain (also, the process of making something shorter) 4. deluge: a sudden large amount of rain (also refers to flooding or an inundation of anything, such as mail delivered to a destination) 5. downfall: a sudden and or heavy rain 6. downpour: a sudden, heavy, continuous burst of rain 7. driving rain: rain pushed by a strong wind 8. drizzle: a light rain of small drops 9. flurry: a brief, light fall of snow (also, a sudden appearance or occurrence, or a brief period of activity or excitement) 10. hail: small balls or lumps of ice and snow (also, something that suggests the impact of hail, such as a hail of bullets) 11. hailstorm: a storm that produces hail 12. ice storm: a freezing rain that leaves ice deposits 13. mist: very small drops of floating or falling moisture (also, a spray of moisture or something that obscures understanding) 14. mizzle: a very fine rain 15. monsoon: very heavy rain associated with a wind that periodically appears throughout the Indian Ocean and Southeast Asia, or the season during which this occurs 16. northeaster (or nor’easter): a rain storm or snowstorm occurring in New England that originates in the northeast 17. precipitation: water in the form of rain or snow; also abbreviated colloquially as precip (also, the process of separating a solid from a liquid) 18. rainfall: the amount of rain that falls in a particular area 19. rainstorm: a storm that produces rain 20. Scotch mist: a mixture of mist and light rain 21. scud: a slight, sudden shower, especially one driven by wind 22. sheet: a moving expanse of rain (also, various other meanings pertaining to broad, thin objects) 23. shower: a short rain of precipitation (also, a fall of meteors or something figuratively resembling a shower, such as an outpouring of support, or a party given for a woman about to marry or give birth, or a bath of water showered on the body or the apparatus for such a bath) 24. sleet: frozen or partly frozen rain 25. snow: ice crystals that fall as precipitation (also, something resembling snow) 26. snowstorm: a storm that produces snow 27. spit: a brief, slight, and perhaps intermittent fall of rain or snow (also, saliva or a similar excretion) 28. sprinkle: a light rain (also, something dropped in small amounts, such as candy sprinkles) 29. squall: a heavy rain with wind 30. sun shower: a short rain that occurs during partial cloud cover 31. tempest: a violent rainstorm 32. thundershower: a brief storm accompanied by lightning and thunder 33. thunderstorm: a storm accompanied by lightning and thunder 34. torrent: a large amount of rain (also, a large amount of water or of anything that flows suddenly) 35. virga: streaks of rain that evaporate before they reach the ground Want to improve your English in five minutes a day? Get a subscription and start receiving our writing tips and exercises daily! Keep learning! Browse the Vocabulary category, check our popular posts, or choose a related post below:Punctuating â€Å"So† at the Beginning of a Sentence225 Foreign Phrases to Inspire YouKn- Words in English