The forums are retiring and are now closed for new topics and comments. The existing content will remain online and accessible through 2020 to provide everyone the opportunity to save any relevant information. In the spring of 2021, these Community forums will be taken offline.

Search for halt in Topics

Roger Boisjoly dies at 73; engineer tried to halt Challenger launch

The death of an Engineer of the highest calibre.,0,2248999.story

Topic by steveastrouk    |  last reply

Sorry for the outage

Our data center had a series of problems that effectively brought Instructables, and a bunch of other servers, to a grinding halt this morning. But, we're back, the problems are isolated, and hopefully won't be repeated. Sorry for the down time!

Topic by ewilhelm    |  last reply

Halo Movie

While i was looking around the internet, i found out that there was a movie called halo, and then i looked at the news, the movie was based on halo. its production has been halted, due to the fact that the two studios backed out before the production could be finish, because like the Tome Raider, they think that i will not be as good as the games. if you have any opinion about this, post away, and ect.

Topic by Mr.Roboto    |  last reply

Man Fights for Right to Dress as Bigfoot

NH artist protests halt to Bigfoot project -------------------- Jan 5, 9:42 PM EST JAFFREY, N.H. (AP) -- A New Hampshire artist and videographer who dressed as Bigfoot in a state park says his rights were trampled by big government. Jonathan Doyle, of Keene, has complained in a letter to the state parks department that a Mount Monadnock park ranger halted his performance art project in the fall because he didn't have a permit. Doyle is arguing through the New Hampshire Civil Liberties Union Foundation that his free-speech rights were violated when he was expelled from the state park in Jaffrey. He says he and others with him, some also in costume, were on a lesser-used trail and weren't bothering other park visitors. Doyle says the state hasn't responded to his letter. The Division of Parks and Recreation says it has been forwarded to the state attorney general's office. -------------------- The question is:  Would you be able to resist the temptation to jump out from behind trees and scare park visitors if you were dressed up as Bigfoot?  I'm not sure that I could should I ever find myself in that rather unlikely situation.

Topic by AngryRedhead    |  last reply

How to replace damaged LCD in iPhone 7

Yesterday while getting out of my car, my phone slipped out of my gym shorts and hit the sidewalk. I came to a complete halt and slowly but carefully picked up my phone. "Maybe it got a couple of scratches and that's it?" But when I flipped the phone over, I discovered that it had a bunch of spiderweb cracks. I would like to repair this myself, I found a good video guide: Should I follow this instuctions, I think it is pretty decent job, what is your opinion?

Topic by jerry9spinger1    |  last reply

i need help about a small mechanism?

Http:// I want to design a electromechanical mechanism which is potable and cell powered,a sensor mounted on a tiny plastic circle and the thing is  attached to a shaft end.when started the shaft is slowly thrusting until the sensor on the shaft end is touched human skin the sensor send signal back to a microchip,the chip halt  the thrusting shaft in case it squeeze the skin hard,  next the  NEEDLES around the sensor begin to work, they piercing through the skin then quickly spring out in case they cause much pain to people. question 1:how to design the shaft thrusting mechanism? question 2:is about the needles,how to pull them back quickly? question 3:can it be wireless controlled? pls help,any of ur suggestion would be greatly appreciated.  

Question by gada888    |  last reply

Any ideas for a every-room-micro-train? Railgun-railsystem?

Hello,my girlfriend and I moved into a new appartment.We allways had this idea of a tiny train that will drive from room to room, to deliver notes or just for the fun of it.After I looked at the miniature model trains (z track) I decided that it both would still require larger holes to be drilled into the walls and a meter of rails costs about 20-25 euros- which would be horrible expensive for a long track.Now I had the idea of using a railgun system and build my first one.(Two strips of aluminum-tinfoil +-9V, a nail with two strong earth magnets on each tinfoil-track) It worked even though I used strong magnets without goldplating and a rough wood plate where I simply "gluegunned" the strips to. It halted at some bumps but still it was amazing how little work this involved.I now think about using a smaller "railgun"-system to power a tiny train-device.Any thoughts if this could work out?I was hoping if I made the curves wide that the angle would not stop the cart.(pic attached also available at )

Topic by schorhr    |  last reply

Could one insulate their attic and/or walls with those stupid plastic grocery bags...safely and effectively, that is?

I have switched to some awesome reusable bags I bought at Office Depot that have a little bag that clips onto your purse or belt-loop. But I joke to the grocery clerks (when they look at me funny when I hand them the bags and say no more plastic) that if I bring home 1 more plastic bag I'm going to drill a hole in my wall and start stuffing them in for question is...Could I Do That? Safely first of all, but also effectively? This would be a HUGE find if it is...We could hit a planetary Royal Flush...Reducing our energy consumption by cheaply over-insulating our homes (an option that would make it possible for poor folk to take advantage too) AND getting those pesky bags off our streets, out of our oceans thereby reducing pollution and halting the devastating effects they have had on the sea life, AND reduce the space they take up in our landfills, PLUS with this as an alternative to having to turning them in, the current backlog of "recycled" bags piling up because this economic down slide reduces the amount of these goods that China is importing to turn into future landfill occupants. So can it be done?

Question by beingteri    |  last reply

Test subjects with working but useless computers needed *please*

 Hi I am looking for some test subjects who are willing to sacrifice their old or junk computer to help me test something very important, please to not feel urged but if you wish to please reply, I will send you a pm with a file if you wish to help. It is a virus but not as you think, it was made fully from a batch file, please hep, I will soon be  pro and may give patches out. THANK YOU if you help. More info: self replicating and running virus which is set to run the first time your computer turns on after you run it, afterwards it needs to take some time to re read the files and re running.1 gb of spce will be filled every 6 minutes so it is kinda deadly but it slows down afterwards, then it self replicates and runs a lot and then you turn you pc off and back on it self replicates again and makes more folders and files until your hard drive comes to a halt, on the slowest computers it can fill a 360 gb drive in 3-5 hours depending on cpu usage. Because it uses to much processing power it is extremely detectable so please help me I will also post a file to stop all of this. Name: qwerty virus

Topic by knex_mepalm    |  last reply

ATi (AMD) GPU Problem Answered

I recently recieved an XFX Radeon HD 6850 card after reluctantly switching from nVidia. My previous card was an MSI N8400GS 512MB DDR2, and wasn't up to spec with the latest games. I installed teh card using standard procedures (grounding myself, carefully removing and inserting cards etc. I have determined it isn't a problem with my setup or power supply, as my system specs exceed all of those required by the card. The only one it didn't meet was PCI-E x16 2.1, mine is on;y 2.0, but I'm told it is backwards compatible, and it wasn't listed as a requirement (only pci-e x16). I have installed the drivers from the ATi website, and uninstalled my old ones. The crd does not run hot at any time, so overheating isn't a problem. The problem is I sometimes heat interference on the headphones, even though I'm using a separate sound card. I also get digital interference on the screen (I'm using DVI). When I try to put any kind of stress on the card (run-in tests, benchmarking, or gaming), the display driver stops responding multiple times, the interference increases, and sometimes the system halts and I have to reset. I can't think of any good reason for this problem other than a faulty card, but I bought it brand new @ factory sealed, with no modifications or over clocking. Any idea what the problem might be?

Question by andy70707    |  last reply

What could be wrong with my Kinroad Runmaster Sahara 250cc dune buggy?

I bought a Kinroad dunebuggy from a guy in Queen Creek, AZ for $1000. It is a yellow 2-seater with a 250cc engine and unifilter. It ran perfect when we tested it, but it has been downhill from there. I drove it around at home on the street for about ten minutes, then- uh oh. I was driving along, relatively slowly, when the gas pedal quit working. As in, it wouldn't make the cart move. When I pressed the gas pedal, it made the engine rev very loud, then stopped when I released. By now the cart was at a full halt. I pressed down on the brake pedal, then let go. That seemed to do it. It happened again in less than 30 seconds, but quickly subsided. I don't know if it was the braking that did it, or if that was just a coincidence. So that didn't happen again. I drove it around for a few more minutes, then shut it off. I came back to it less than an hour later. It started, I put in forward, and then when I pressed the gas- it died. No go. I tried again. No go. Finally, i started it, then revved it once for about 5 seconds in neutral. Then, when I put it in forward and gassed it, it went. It rode fine for a little while. I shut it off. When I came back and started it up- same as before. Whenever I gassed it, it quit. Finally, for whatever reason, it went. That lasted for about ten seconds. Then it quit. It hasn't started since, after maybe 20 more tries. So- any guesses as to the problem? Any help would be greatly appreciated.

Question by snowpenguin    |  last reply

How can I convert a rechargeable beard trimmer to strictly a/c?

First of all, I love this trimmer. I've had it for probabaly 15 years. The settings are so precise and I'm so used to it that I would hate to replace it. It is a rechargeable model, which plugs into a cord, not a charging stand. The battery hasn't charged in probabaly 10 years. But since it stopped charging, I was able to keep using it by having it plugged in. I was able to do this for a long time until several days ago. When I'd turn it on while plugged into the outlet, the motor would barely even run. So I took it apart, looked around, and figured I would try to replace the rechargeable battery inside. I sourced a battery, installed it, and the trimmer worked again. I charged it overnight and went to use it the next morning. I got about halfway through when it just completely died on me. So I would turn it off for a few minutes, let it maybe charge a little and try to finish my trimming. At this point, I could maybe get 30 seconds of really weak performance before it would grind to a halt. I tried plugging it in and using it that way, as I had done so many times before, but that wouldn't work either. Can anyone advise me as to what's going on here? Why was I able to use it for so many years with the a/c/ cord and a dead battery, but now with a fresh battery, the a/c cord is useless for operation and obviously useless for charging as well? So I'm wondering if there might be a way to convert this trimmer to strictly a/c, remove the battery from the eqation, and operate it that way? I'm no electronics guru, by any means. But If instructed, I'm sure I could get this thing operational again. I don't care about it being battery powered anyway. I use it in the bathroom where there are a couple of very handy outlets. Thanks.

Question by chinaski    |  last reply

What the Candidates Say About Energy

What the Candidates Say About Energy GIULIANI: Says "every potential solution" must be pursued, including nuclear power, increased energy exploration and more aggressive investment in alternative energy sources. Says energy independence can be achieved through a strategy that emphasizes diversification, innovation and conservation.MIKE HUCKABEE: Wants to lessen U.S. dependence on foreign oil by pursuing "all avenues" of alternative energy: nuclear, wind, solar, hydrogen, clean coal, biodiesel and biomass.JOHN MCCAIN: Wants to limit carbon dioxide emissions "by harnessing market forces" that will bring advanced technologies, such as nuclear energy, to the market faster. Seeks to reduce dependence on foreign supplies of energy. Wants the U.S. to lead in a way that ensures all nations "do their rightful share" on the environment. As you may know,McCain was AWOL in December on the key Senate vote to secure an 8-yearSolar Investment Tax Credit extension -- and he could have been the hero by casting the 60thvote (it failed 59 to 40 with only McCain being AWOL).MITT ROMNEY: Wants to accelerate construction of nuclear power plants as part of a "robust, cleaner and reliable energy mix." Seeks energy independence not by halting all oil imports but by "making sure that our nation's future will always be in our hands."DemocratsHILLARY CLINTON: Says she's "agnostic" about building nuclear power plants. Prefers renewable energy and conservation because of concerns about nuclear power's cost, safety and waste disposal. Wants to spend $150 billion over the next 10 years to cut oil imports by two-thirds from 2030 projected levels, with some money going toward alternative energy.JOHN EDWARDS: Opposes nuclear power because of cost and safety concerns. Favors creating a $13 billion-a-year fund to finance research and development of energy technologies; wants to reduce oil imports by nearly a third of the oil projected to be used in 2025.BARACK OBAMA: Says the U.S. can't meet its climate goals if it removes nuclear power as an option but says such issues as security of nuclear fuel, waste and waste storage need to be addressed first. Wants to spend $150 billion over the next 10 years to develop new energy sources. Seeks to reduce"oil consumption overall by at least 35 percent by 2030."

Topic by ewilhelm    |  last reply

Why the Advancements in Knex Gun Technology Have Stopped

     I, as many other members of the online k’nex gun making community may have, noticed that particular aspects of k’nex weaponry have stopped evolving. The very best k’nex guns of today are guns such as the TR18, the ZKAR, and other far shooting, rapid-fire guns. Now that’s fine, but other aspects of guns have stopped evolving, and innovation has been halted. This is ironic considering many of our communities best builders belong to forum with innovation in its name, and we have so many builders advocating innovation in everything they say. The reason for this lack of new ideas is that the members of our community are not sharing their ideas with each other and encouraging others to build off them. I will explain this theory in my following paragraph.       Out of everything that has been made in the world, it was all developed because people want to top each other and people build off of each other’s ideas and accomplishments. Unfortunately, this is not happening in the k’nex online community. The biggest example is the everlasting KI/Instructables rift that has separated k’nex builders since even before the creation of Knex Innovation. No knexer even thinks of sharing the guns they’re developing with a knexer of the opposing site. Even bigger than that though, is the reluctance to share ideas with anyone. How many times have you seen people anywhere saying that they are building a new gun, but they won’t share pictures because they’re scared of people copying them? This is what hampers all creativity and innovation. If people cannot build off the ideas of other people, we will never advance. Sure we’ve gotten this far off people’s successful ideas that they’ve posted, but imagine how far we could be if everyone shared their failures as well. We could fix the guns that others could not get to work. Imagine all the possibilities if every single mech anyone ever tried to make was open to the public to use and improve on. Now this happens not only in Instructables where everyone goes crazy if they think someone even slightly copied their gun, and never shares their ideas with others except for those rare collaborations. This also happens at KI where there is a whole “secret forum” that the most experienced builders and contest winners get to see, where they post their ideas where all the other builders can’t see them. This selfishness needs to end so that we can continue innovating and creating new guns and ideas.

Topic by jollex    |  last reply

PCB Repair Process of 3 different kind of circuits

1 Power Supply Circuit: During the circuit board repair process, power supply part should be inspected at the first hand and then come to the other part. +/-5V, Power supply failure can occur under below several situation: (1) NO power supply voltage or power supply voltage is deficiency, NC system is often used +/-5V, +/-12V, +/-15V and +/-24V, a few of them use +3.3V, and the varied or unstable voltage of power supply will cause the system working impropery; (2) Use voltmeter to test the voltage of power supply, and the result show is normal. Voltage waveform detected by oscillograph has shown the existence of big ripple. This situation maybe caused by open circuit of Filtering capacitance, bad rectifier diode or cold soldering, but sometimes it could be caused by an overloaded component which has been brokendown and damaged by power. (3) System can run properly when it is just being opened, after a while of operating, the voltage begin to drop off. This is usually caused by voltage stabilizing circuit and large power triode. (4) The voltage decrease accompany with temperature increase maybe cause by component cold soldering, it is electrical connection can be affected negatively when the temperature high up. (5) NO power supply voltage or supply voltage decreases significantly will cause the system to interrupt or stop working, this fault can be detected and spotted easier. (6) When the capacity of power supply load drop off or filter circuit become invalid, it will cause the system halt suddenly, this situation which is very difficult to justify can bring damage to the equipment and facility even get personnel wound. 2 Clock Circuit: Clock circuit mainly exist on the systematic motherboard, it is the foundation of large-scale integrated circuit system through which it can work, it can generate the constant square signal in the circuit base upon the crystal oscillator (commonly known as crystal), Once the crystal oscillator stop working, it is same as the heart of human being stop beating, the whole system will fall into the status of paralyzed, only after crystal can work under normal condition, the systematic circuit can operate under the command of CPU according to the frequency of crystal. The number and frequency of the crystal could be different due to the variety of numerical control system, but generally will at least one crystal, different clock frequencies required by the other circuit can be solved by frequency dividing circuit or other crystal. Crystal possess a higher rate of failure or damage, below are some malfuntions of crystal: (1) Leakage: Use multimeter and switch to P*10K level to test it, if the resistance is infinite, then it can be viewed as normal; (2) Internal OPEN CIRCUIT: Value of resistance is infinite tested by Use multimeter, can fail to generate oscillating pulse in the circuit; (3) Alternative crystal: Due to the transformation of crytal will cause its internal parameter change which can only be detected by osillagraph or cymometer. Although the crystal can still has oscillation, but the clock frequency is deviated from its nominal value, and the still existing oscillation pulse can’t make system circuit work properly due to the value of oscillation is wrong. Only cymometer can test its tolerance now. (4) In clock circuit, the both ends of crystal would be connected to ground by one ceramic capacitor value range from several picofarads to tens picofarads, failure of the clock circuit result from this capacitor leakage, deterioration is also more common. The best tool to test whether the crystal is good or bad could be oscillagraph or cymometer, multimeter is very difficult to detect the root cause. 3 Reset Circuit Reset circuit also exist in the circuit system of motherboard, it is unique set of large-scale digital integrated circuit. Microprocessor and interface circuit are all possess reset terminal. Reset pulse generate by reset circuit will clear the progam counter, force CPU recall the orginal files from the memory, execute initiation process on all the controller chips, system will occurs the phenomenon of disorder or crash as a result of faulty reset circuit, the method of using cymometer to illustrate the reset pulse is turn on/off power supply repeatly, observe and record the pulse value at the right moment of power supply on/off since it should be the normal square wave-form. If there is no existence of reset pulse, all the resistor, capacitor and transistor in the reset circuit should be detected. The reset terminal of integrated circuit should be regular low or high electrical level, or else, it is probably the malfunctional reset circuit or damaged integrated circuit.

Topic by circuiteng    |  last reply

Questions about making computer systems from discrete components?

I am interested in building certain components of computer processors with the use of discrete components only. I want to build on the individual component level (transistors, resistors, caps) and not on the gate level (quad and gate or hex inverter ic) and I have run into some problems. I have a few questions and they are large. If you can answer any of them I would be glad but could you number them so I know which one you are talking about. ((1)) My first question is about how to build logic gates with discrete components. I have seen some schematic diagrams for and gates, or gates and inverters; they all seem to have some problems. For example, an and gate might have two bjt's where the base of each is an input. My question stems from the saturation voltage of transistors. I assume that in logic circuits you want a transistor to act as a switch, and thus would want to make sure that the voltage drop is 0. I learned that to do this, you find the resistance value of the load you are trying to run and figure how much current it would take for the voltage drop to be Vcc. (Light bulb has a resistance of 100ohms, Vcc is 10V, V=IR dictates that the current running through the light bulb would be .1A). Then you divide this current by B (gain of transistor) to find the current that needs to be running through the base emitter path. How do you find the load of a computer, where the output of a circuit might run through paths of great or little resistance? Is there a way to make logic circuits with transistors acting like switches while avoiding finding the saturation voltage? ((2)) How are computers made so that they can sit idle and then respond to inputs. This might sound like a stupid question but from a programming perspective the only way I could think to do it would be to create an infinite loop that constantly checks for inputs or a 1 in some input register.  The more I think about it the more it seems possible that this is how computers do it now; I know that the're able to run many programs at once so it seems possible. However, how did early computers do it? If a computer had only the capacity to run one program at a time then it seems a program accepting inputs would always have to come to a halt when an input is requires. Is this truely the only way? How do modern computers accept inputs, how do computers that can only run 1 program at a time accept inputs? ((3)) I am also interested in memory circuitry. Looking at the types of ram, dram seems to be pretty strait forward. As I understand it sram is essentially memory made of logic grates where an outside signal initially acts as an input. The output of the logic circuit is then feed back in as an input and the circuit hold "itself" high or low (this description might be totally wrong). The problem is I have only seen schematics that show sram using CMOS. Is there a way to build sram using bjt's? ((4)) I have also had a chance to look at how rewritable rom (despite being read only) such as flash memory works. My first question is, why is this called read only? I get that it is nonvolatile so it's not ram, but it surely isn't read only memory either! Are there any ways to make rewritable rom with discrete components? Flash involves, to my understanding, trapping electrons with some kind of tunneling. As far as I know, this can only be done in silicon. If I were to make some sort of computer (or more accurately: a device that demonstrates the properties of a computer) would the non volatile memory be limited to non-electrical things (brain, punch card, magnetic memory)? ((5)) How are jumps done in the opcode level? Assembly has specific commands for different types of jumps. Lets say you are running an 8 bit computer that had 8 bits of memory at each address, can't you only address 256 addresses (0 to 255)? Lets say the 8 bit computer processor has 128 unique operations, and an unconditional jump happens to be the 100th operation. In the memory you write your program to, the jump would be written as 1100100 (100 in decimal, the jump command). There would only be 1 bit left, hardly enough room to write the address of where you are actually trying to jump to. My only conclusion is that you would tack a 0 to the front of the jump command making 01100100 and filling up the whole byte of memory. Then, when the computer reads the byte it recognizes the opcode for unconditional jump and reads the next byte of memory as the location of the jump and not  as a specific jump. Thus if you were trying to write an unconditional jump to address zero, the program would look like: ........ ........ 01100100 00000000 Is this how computers perform operations containing operational code and memory addresses that are written as one line in assembly code? Thanks for your time and help!

Question by seanroberts    |  last reply

Oil Spill Water Cleanups As Fast As They Happen

We live and survive on oil today. That dependence won’t go away for at least a few more generations. Today’s technology allows us to drill oil just about anywhere in the world, and then move it to anywhere we want using behemoth water vessels. Unfortunately, there’s a dark side to all this and it happens when our technology fails us, as periodically demonstrated by mankind’s great oil spill disasters. The most recent being the Gulf Oil Spill of 2010. The amount of oil actually dumped upon our ecosphere and contaminating the environment was mind boggling. The numbing numbers are so large that we can’t even get our minds around it. And we all know that the responsible drilling company won’t fess up to how much was really spilled because even they don’t know, don’t want to know and furthermore want to forget about it. Is there some way to tackle this oil spill problem through the use of the very culprit that created it, namely technology? Of course there is, but it will cost the billions they used to clean up the mess they created in the first place.  We want to develop a technological process to be used worldwide that borrows from what we currently know, and clean up these oil spills almost as quickly as they happen upon our seascape. Did we finally clean up the Gulf oil spill?  Yes, maybe? But it took too long and we either didn’t use the right equipment or not enough prepared and available equipment to check the problem. Time is probably the most critical factor involved in mitigating oil spill disasters. While Nature obviously works to clean up ecological disasters, she takes perhaps a decade or more to make a region whole again. We need to help nature accelerate her time schedule to a few weeks not decades! Oil cleanup equipment exists that is too painstakingly slow and inefficient to get the job done quickly and effectively, and to recapture ~99% of the oil spilled. Today’s processes are makeshift, disjointed, and not organized nor designed to tackle today’s mega-proportion oil spill problems.  We need a cohesive mega-solution to handle mega-problem oil spills. A virtual army of specialists with proper equipment to attack, gather up and capture, then deliver the spilled oil to vessel staging platforms. These huge platforms will separate 99.9% of the captured oil/water, dumping the water back.  Oil tankers on standby then take this recaptured crude oil to refineries. This process must be set up with the proper equipment to dynamically proceed in real time. Only high sea states should be capable of halting its operation. The process of oil/water cleanup requires the serial use of various sequential operations where each performs a key stage of the operatic procedure. The orchestration starts with techniques that initially yield the biggest volumetric punch first, then refines this processing by using less volumetric cleaning ability but greater oil separation capability. All the while we have deployed an improved form of today’s containment apron, capable of hundreds of miles of coverage to prevent spreading the spilled oil slick to shore. Having researched today’s available oil spill removal systems, their usefulness has been categorized according to volumetric processing capability per time. Fast surface skimming techniques plus “huge”, constant flowing centrifugal separators clearly win, but are not 100% effective. Sponge-type, oil absorbent techniques then come to play as they are useful in nearly recapturing the remaining 0.1% oil from the water, but are slow and will be used solely on the remaining 99.99% pure water expelled from our centrifugal oil separators. Today we literally use these absorbers like sponges, dunking them into the oil slick, waiting awhile and pulling them out after they’ve absorbed some oil. Such prolonged processing times are unacceptable. Absorbers are to be used differently than today, their performance is vastly accelerated as they now act as 0.1% oil filters to process the pressurized water expelled from the centrifugal separators. The final residuals of perhaps 0.01% that the high pressure absorber filtration misses will require oil break down chemistry whose end products are environmentally friendly and allows Nature to restore balance. So the actual water dumped back will be better than 99.99% pure. Now let’s break this process down a bit and address the pieces of equipment involved. Our attack vessels are special, high speed catamarans that ferry cars between different ports today. They use water-jet propulsion, are extremely fast, maneuverable, and will be equipped with a special front-end water scoop to pick up the oil/water slick in real time while propelled forward. Their scoop or nozzle articulates, performing real time adjustments responding to oil slick depths thereby avoiding too much water pickup. Once their holding tanks are full, they reconnoiter with waiting intermediate-sized tankers to quickly dump their oil/water cargo. When these tankers are full, they deposit their load to one of the huge vessel platforms. These staging platforms use centrifugal systems to quickly and efficiently separate huge quantities of the oil and water, and dump the 99.9% cleaned water overboard (Nature effectively handles the remaining 0.1% of oil). When their tanks are full of oil, they start emptying themselves into the large standby oil tankers for delivery to refineries. QED. For you science fiction/fact fans, this concept requires enormous equipment, is on a huge scale and if viewed as one harmonious system may be the first Oil-Terra-Forming machine to be used on our planet.  

Topic by RT-101    |  last reply

Problem in arduino code... you'll have to run this one to understand - Word Clock? Answered

I have been writing this code for the Word clock. I am trying to customize the code to fit into an atmega8, and use DS1307 RTC. Both of these is fine, but what is wrong is that when I upload my code and try to set the time by using the buttons, the time is not setting properly. I can increment minutes with the minutes button to 16, but not further. Hours works fine, but if, lets say the time is 6:36 on the arduino, then If I press the hour button, I find that time changes to 7:31. Five minutes less than what I expected. What am I overlooking here?  I advise to run the code and understand the problem. On the other hand Binary sketch size: 7164 bytes (of a 7168 byte maximum), this is just 4 bytes short of max. Can that be a part of the problem Code: #include // Display output pin assignments #define MTEN  Display1=Display1 | (1<<0)  #define HALF Display1=Display1 | (1<<1) #define QUARTER Display1=Display1 | (1<<2) #define TWENTY Display1=Display1 | (1<<3) #define MFIVE Display1=Display1 | (1<<4) #define MINUTES Display1=Display1 | (1<<5) #define PAST Display1=Display1 | (1<<6) #define UNUSED1 Display1=Display1 | (1<<7) #define TO Display2=Display2 | (1<<0) #define ONE Display2=Display2 | (1<<1) #define TWO Display2=Display2 | (1<<2) #define THREE Display2=Display2 | (1<<3) #define FOUR Display2=Display2 | (1<<4) #define HFIVE Display2=Display2 | (1<<5) #define SIX Display2=Display2 | (1<<6) #define UNUSED2 Display2=Display2 | (1<<7) #define SEVEN Display3=Display3 | (1<<0) #define EIGHT Display3=Display3 | (1<<1) #define NINE Display3=Display3 | (1<<2) #define HTEN Display3=Display3 | (1<<3) #define ELEVEN Display3=Display3 | (1<<4) #define TWELVE Display3=Display3 | (1<<5) #define OCLOCK  Display3=Display3 | (1<<6) #define UNUSED3 Display3=Display3 | (1<<7) #define DS1307_I2C_ADDRESS 0x68  // This is the I2C address #if defined(ARDUINO) && ARDUINO >= 100   // Arduino v1.0 and newer   #define I2C_WRITE Wire.write   #define I2C_READ #else                                   // Arduino Prior to v1.0   #define I2C_WRITE Wire.send   #define I2C_READ Wire.receive #endif int  hr=12, mn=00, scnd=0; static unsigned long msTick =0;  // the number of Millisecond Ticks since we last                                  // incremented the second counter int  count; boolean selftestmode; boolean  DS1307Present=false;       // flag to indicate that the 1307 is there..    1 = present char Display1=0, Display2=0, Display3=0; // hardware constants static unsigned int LEDClockPin=5;    //11 d5 ok static unsigned int LEDDataPin=3;    //5 d3 static unsigned int LEDStrobePin=4;   //6 d4 static unsigned int MinuteButtonPin=6;  //d6 12 static unsigned int HourButtonPin=7;    //d7 13 static unsigned int PWMPin = 11; char buf[50]; // time output string for debugging byte decToBcd(byte b) {  return ( ((b/10) << 4) + (b%10) );} // Convert binary coded decimal to normal decimal numbers byte bcdToDec(byte b) {  return ( ((b >> 4)*10) + (b%16) );} void getTime() {   //read from chip and store in hr, mn, scnd   Wire.beginTransmission(DS1307_I2C_ADDRESS);   I2C_WRITE((uint8_t) 0x00);   Wire.endTransmission();     Wire.requestFrom(DS1307_I2C_ADDRESS, 3);   scnd = bcdToDec(I2C_READ());   mn =  bcdToDec(I2C_READ());   hr =  bcdToDec(I2C_READ()); } void setTime() {   //to be paranoid, we're going to first stop the clock   //to ensure we don't have rollovers while we're   //writing:   writeRTCreg(0,0x80);   //now, we'll write everything *except* the second   Wire.beginTransmission(DS1307_I2C_ADDRESS);   I2C_WRITE((uint8_t) 0x01);   I2C_WRITE(mn);   I2C_WRITE(hr);   Wire.endTransmission();   //now, we'll write the seconds; we didn't have to keep   //track of whether the clock was already running, because   //scnd already knows what we want it to be. This   //will restart the clock as it writes the new seconds value.   writeRTCreg(0,scnd); } byte readRTCreg(byte adr) {    if(adr > 0x3F) { return 0xff; }   Wire.beginTransmission(DS1307_I2C_ADDRESS);   I2C_WRITE(adr);   Wire.endTransmission();   Wire.requestFrom(DS1307_I2C_ADDRESS, 1);   return I2C_READ(); } void writeRTCreg(byte adr, byte val) { if(adr > 0x3F) { return; }    Wire.beginTransmission(DS1307_I2C_ADDRESS);    I2C_WRITE(adr);    I2C_WRITE(val);    Wire.endTransmission(); } void print_DS1307time() {   /* Format the time and date and insert into the temporary buffer */   snprintf(buf, sizeof(buf), "RTC time: %02d:%02d:%02d",   hr, mn, scnd);   /* Print the formatted string to serial so we can see the time */   Serial.println(buf); } void setup() {   // initialise the hardware   // initialize the appropriate pins as outputs:   pinMode(LEDClockPin, OUTPUT);   pinMode(LEDDataPin, OUTPUT);   pinMode(LEDStrobePin, OUTPUT);       //pinMode(BrightnessPin, INPUT);   pinMode(MinuteButtonPin, INPUT);   pinMode(HourButtonPin, INPUT);   digitalWrite(MinuteButtonPin, HIGH);  //set internal pullup   digitalWrite(HourButtonPin, HIGH); //set internal pullup   pinMode(PWMPin, OUTPUT);     Serial.begin(9600);   Wire.begin();    // test whether the DS1302 is there   Serial.print("Verifying DS1307 ");   // start by verifying that the chip has a valid signature   if (readRTCreg(0x20) == 0x55) {     // Signature is there - set the present flag and mmove on     DS1307Present=true;     Serial.println("Valid Signature");   }   else   {     // Signature isnt there - may be a new chip -     //   do a write to see if it will hold the signature     writeRTCreg(0x20,0x55);     if (readRTCreg(0x20) == 0x55) {       // We can store data - assume that it is a new chip that needs initialisation /*      // Start by clearing the clock halt flag.           //"Bit 7 of register 0 is the clock halt (CH) bit.           //When this bit is set to a 1, the oscillator is disabled."             byte _reg0_sec = decToBcd(scnd);             _reg0_sec = _reg0_sec & ~0x80;             writeRTCreg(0,_reg0_sec); */       // Set the time and date on the chip       scnd = 0;       mn = 0;       hr = 12;       setTime();       // set the DS1302 present flag       DS1307Present=true;       Serial.println("present - new chip initialised.");     }     else  Serial.println("absent");   }    msTick=millis();      // Initialise the msTick counter     selftest();   selftestmode=false;   if (DS1307Present) {     // Get the current time and date from the chip    getTime();     }     displaytime();        // display the current time } void ledsoff(void) { Display1=0; Display2=0; Display3=0; } void WriteLEDs(void) { // Now we write the actual values to the hardware shiftOut(LEDDataPin, LEDClockPin, MSBFIRST, Display3); shiftOut(LEDDataPin, LEDClockPin, MSBFIRST, Display2); shiftOut(LEDDataPin, LEDClockPin, MSBFIRST, Display1); digitalWrite(LEDStrobePin,HIGH); delay(2); digitalWrite(LEDStrobePin,LOW); } void selftest(void){   Serial.print("TEST");   analogWrite(PWMPin, 255);     ledsoff(); MTEN; WriteLEDs(); delay(500);   ledsoff(); HALF; WriteLEDs(); delay(500);   ledsoff(); QUARTER; WriteLEDs(); delay(500);   ledsoff(); TWENTY; WriteLEDs(); delay(500);   ledsoff(); MFIVE; WriteLEDs(); delay(500);   ledsoff(); MINUTES; WriteLEDs(); delay(500);   ledsoff(); PAST; WriteLEDs(); delay(500);   ledsoff(); TO; WriteLEDs(); delay(500);   ledsoff(); ONE; WriteLEDs(); delay(500);   ledsoff(); TWO; WriteLEDs(); delay(500);   ledsoff(); THREE; WriteLEDs(); delay(500);   ledsoff(); FOUR; WriteLEDs(); delay(500);   ledsoff(); HFIVE; WriteLEDs(); delay(500);   ledsoff(); SIX; WriteLEDs(); delay(500);   ledsoff(); SEVEN; WriteLEDs(); delay(500);   ledsoff(); EIGHT; WriteLEDs(); delay(500);   ledsoff(); NINE; WriteLEDs(); delay(500);   ledsoff(); HTEN; WriteLEDs(); delay(500);   ledsoff(); ELEVEN; WriteLEDs(); delay(500);   ledsoff(); TWELVE; WriteLEDs(); delay(500);   ledsoff(); OCLOCK; WriteLEDs(); delay(500); } void displaytime(void){   // start by clearing the display to a known state   ledsoff();     Serial.print("It is ");   // now we display the appropriate minute counter   if ((mn>4) && (mn<10)) {     MFIVE;     MINUTES;     Serial.print("Five Minutes ");   }   if ((mn>9) && (mn<15)) {     MTEN;     MINUTES;     Serial.print("Ten Minutes ");   }   if ((mn>14) && (mn<20)) {     QUARTER;       Serial.print("Quarter ");   }   if ((mn>19) && (mn<25)) {     TWENTY;     MINUTES;     Serial.print("Twenty Minutes ");   }   if ((mn>24) && (mn<30)) {     TWENTY;     MFIVE;     MINUTES;     Serial.print("Twenty Five Minutes ");   }    if ((mn>29) && (mn<35)) {     HALF;     Serial.print("Half ");   }   if ((mn>34) && (mn<40)) {     TWENTY;     MFIVE;     MINUTES;     Serial.print("Twenty Five Minutes ");   }    if ((mn>39) && (mn<45)) {     TWENTY;     MINUTES;     Serial.print("Twenty Minutes ");   }   if ((mn>44) && (mn<50)) {     QUARTER;     Serial.print("Quarter ");   }   if ((mn>49) && (mn<55)) {     MTEN;     MINUTES;     Serial.print("Ten Minutes ");   }   if (mn>54) {     MFIVE;     MINUTES;     Serial.print("Five Minutes ");   }   if ((mn <5))   {     switch (hr) {     case 1:       ONE;       Serial.print("One ");       break;     case 2:       TWO;       Serial.print("Two ");       break;     case 3:       THREE;       Serial.print("Three ");       break;     case 4:       FOUR;       Serial.print("Four ");       break;     case 5:       HFIVE;       Serial.print("Five ");       break;     case 6:       SIX;       Serial.print("Six ");       break;     case 7:       SEVEN;       Serial.print("Seven ");       break;     case 8:       EIGHT;       Serial.print("Eight ");       break;     case 9:       NINE;       Serial.print("Nine ");       break;     case 10:       HTEN;       Serial.print("Ten ");       break;     case 11:       ELEVEN;       Serial.print("Eleven ");       break;     case 12:       TWELVE;       Serial.print("Twelve ");       break;     }   OCLOCK;   Serial.println("O'Clock");   }   else     if ((mn < 35) && (mn >4))     {       PAST;       Serial.print("Past ");       switch (hr) {     case 1:       ONE;       Serial.println("One ");       break;     case 2:       TWO;       Serial.println("Two ");       break;     case 3:       THREE;       Serial.println("Three ");       break;     case 4:       FOUR;       Serial.println("Four ");       break;     case 5:       HFIVE;       Serial.println("Five ");       break;     case 6:       SIX;       Serial.println("Six ");       break;     case 7:       SEVEN;       Serial.println("Seven ");       break;     case 8:       EIGHT;       Serial.println("Eight ");       break;     case 9:       NINE;       Serial.println("Nine ");       break;     case 10:       HTEN;       Serial.println("Ten ");       break;     case 11:       ELEVEN;       Serial.println("Eleven ");       break;     case 12:       TWELVE;       Serial.println("Twelve ");       break;       }     }     else     {       // if we are greater than 34 minutes past the hour then display       // the next hour, as we will be displaying a 'to' sign       TO;       Serial.print("To ");       switch (hr) {       case 1:         TWO;        Serial.println("Two ");        break;       case 2:         THREE;       Serial.println("Three ");         break;       case 3:         FOUR;       Serial.println("Four ");         break;       case 4:         HFIVE;       Serial.println("Five ");         break;       case 5:         SIX;       Serial.println("Six ");         break;       case 6:         SEVEN;       Serial.println("Seven ");         break;       case 7:         EIGHT;       Serial.println("Eight ");         break;       case 8:         NINE;       Serial.println("Nine ");         break;       case 9:         HTEN;       Serial.println("Ten ");         break;       case 10:         ELEVEN;       Serial.println("Eleven ");         break;       case 11:         TWELVE;       Serial.println("Twelve ");         break;       case 12:         ONE;       Serial.println("One ");         break;       }     }    WriteLEDs();    } void incrementtime(void){   // increment the time counters keeping care to rollover as required   scnd=0;   if (++mn >= 60) {     mn=0;     if (++hr == 13) {       hr=1;      }   }    // debug outputs   Serial.println(); //  if (DS1307Present) //  print_DS1307time(); //  else{ //  Serial.print("Arduino Time: " );   Serial.print(hr);   Serial.print(":");   Serial.print(mn);   Serial.print(":");   Serial.println(scnd); //  } } void loop(void) {     //selftest(); int aread = sq(analogRead(3)/4)+3;   //Uncomment the following line and comment the next one in order to   //  enable dimming via a potentiometer connected to pin 0:   analogWrite(PWMPin, aread>255 ? 255:aread);   //analogWrite(PWMPin, 255);       // heart of the timer - keep looking at the millisecond timer on the Arduino     // and increment the seconds counter every 1000 ms     if ( millis() - msTick >999) {         msTick=millis();         scnd++; /*        // Flash the onboard Pin13 Led so we know something is hapening!         digitalWrite(13,HIGH);         delay(100);         digitalWrite(13,LOW);    */    }                 //test to see if we need to increment the time counters     if (scnd==60)     {       incrementtime();       displaytime();     } if (DS1307Present) {     // Get the current time and date from the chip      getTime();     }     // test to see if a forward button is being held down     // for time setting     if ( (digitalRead(MinuteButtonPin) ==0 ) && scnd!=1)       // the forward button is down       // and it has been more than one second since we       // last looked     {       mn=(((mn/5)*5) +5);       scnd=0;       incrementtime();       scnd++;  // Increment the second counter to ensure that the name       // flash doesnt happen when setting time       if (DS1307Present) {       // Set the time on the chip       setTime();     }     delay(100);       displaytime();     }     // test to see if the back button is being held down     // for time setting     if ((digitalRead(HourButtonPin)==0 ) && scnd!=1)     {       /*       minute=(((minute/5)*5) -5);       second=0; // decrement the minute counter       if (minute<0) {         minute=55;         if (--hour <0) hour=12;       }       */             mn = (mn/5)*5;  //round minute down to previous 5 min interval       if (++hr == 13) {         hr=1;        }       incrementtime();       scnd++;  // Increment the second counter to ensure that the name       // flash doesnt happen when setting time        if (DS1307Present) {       // Set the time and date on the chip       setTime();     }     delay(100);       displaytime();     } }

Question by pro2xy    |  last reply

A advanced Arduino calculator?

So I thought about a new project: make an "advanced" calculator since online there are plenty of tutorials of simple ones. I have done already the circuit and I have only some problems with the code since this is only my third project on Arduino and I don't  know programming in C. So basically: when I switch on the device it shows me a long text which I can scroll using a pair of pushbuttons(when the text can't scroll anymore a led switches on). When I push them contemporanealy the device switches to calculator. And this is the code I made (I know there are plenty of errors): #include #include long num1,num2 ; double total; char operation,button; const byte ROWS = 4; const byte COLS = 4; char keys[ROWS][COLS] = {   {'1','2','3','+'},   {'4','5','6','-'},   {'7','8','9','*'},   {'C','0','=','/'} }; byte rowPins[ROWS] = {A0,A1,A2,A3}; //connect to the row pinouts of the keypad byte colPins[COLS] = {A4,A5,0,1}; //connect to the column pinouts of the keypad Keypad customKeypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS); // === CONSTANTS AND GLOBALS === // -- PINS -- const int PIN_LCD_LED = 6;  // analog const int PIN_ERR_LED = 7;  // digital const int PIN_BUTTON1 = 8;  // digital const int PIN_BUTTON2 = 9;  // digital // -- LCD -- // PIN 12   -> RS // PIN 11   -> Enable // PINS 2-5 -> D4-7 LiquidCrystal lcd(12, 11, 2, 3, 4, 5); // number of columns in the LCD const int LCD_COLS = 16; // LCD brightness [0, 255] const int LCD_BRIGHTNESS = 128; // LCD ON or OFF int state_lcd = LOW; // start position for text int lcd_start = 0; // -- LED -- // LOW -> LED is OFF - HIGH -> LED is ON int state_led = LOW; // stores time when turned LED on unsigned long t0_led; // timeout to turn the LED off const int LED_TIMEOUT = 500; // -- text to print -- // ASSUMPTION: text always longer than LCD_COLS, if not add a check in loop const char TEXT[] = "After trying Helloworld I made this more advanced version..."; const int TEXT_LEN = (sizeof(TEXT) / sizeof(char)) - 1; const int LCD_LIMIT = TEXT_LEN - LCD_COLS; // === CONSTANTS AND GLOBALS END === // === INITIALIZATION === void setup() {   // -- SET DIGITAL PINS --   pinMode(PIN_BUTTON1, INPUT);   pinMode(PIN_BUTTON2, INPUT);   pinMode(PIN_ERR_LED, OUTPUT);   // -- SET UP LCD --   lcd.begin(16,2);   lcd.noDisplay();   digitalWrite(PIN_LCD_LED, state_lcd);   // ERROR LED is off when starting   digitalWrite(PIN_ERR_LED, state_led);   // -- read buttons --   int state_button1 = digitalRead(PIN_BUTTON1);   int state_button2 = digitalRead(PIN_BUTTON2);     // pushed button 1 -> try to scroll left or turn LED on if can't     if(HIGH == state_button1)     {       if(lcd_start > 0)       {         lcd_start--;         state_led = LOW;         digitalWrite(PIN_ERR_LED, state_led);         delay(200);       }       else       {         state_led = HIGH;         digitalWrite(PIN_ERR_LED, state_led);         t0_led = millis();       }     }     // pushed button 2 -> try to scroll right or turn LED on if can't     if(HIGH == state_button2)     {       if(lcd_start < LCD_LIMIT)       {         lcd_start++;         state_led = LOW;         digitalWrite(PIN_ERR_LED, state_led);         delay(200);       }       else       {         state_led = HIGH;         digitalWrite(PIN_ERR_LED, state_led);         t0_led = millis();       }     }     // -- print text on the LCD --     for(int i = 0; i < LCD_COLS; i++)     {       lcd.setCursor(i, 0);       lcd.print(TEXT[lcd_start + i]);     }     // ERROR LED is ON     if(HIGH == state_led)     {       unsigned long td = millis() - t0_led;       // LED has been ON for more than LED_TIMEOUT ms. -> turn it OFF       if(td > LED_TIMEOUT)       {         state_led = LOW;         digitalWrite(PIN_ERR_LED, state_led);       }     }   }   // normally 20FPS   // === INITIALIZATION END === // === MAIN LOOP === void loop() {   // == LCD STILL OFF ==   if(HIGH == state_lcd)   {     // pushing both buttons -> turn LCD on     int state_button1 = digitalRead(PIN_BUTTON1);     int state_button2 = digitalRead(PIN_BUTTON2);         if(HIGH == state_button1 && HIGH == state_button2)     {       analogWrite(PIN_LCD_LED, LCD_BRIGHTNESS);       lcd.display();       state_lcd = HIGH;       delay(250);     }   }     else  // == LCD ON ==   {     // Loops are convenient for reading key press from keypad     while(1) // First loop. Here we read keypad and compose our first number. It does so untill we press operation button and break's out of loop or 'C' and it starts from beginning of this loop     {                 button = customKeypad.getKey(); // Button read         if (button=='C') // If user wants to resset while he is writing first number         {           num1=0;           num2=0;           total=0;           operation=0;           lcd.clear();         }                 if (button >='0' && button <='9') // If user pressed numeric value, 1 character at a time.         {           num1 = num1*10 + (button -'0'); // Our numeric values are 0-9 witch means they are in first decade, when we multiply with 10 we basicaly add zero after number,           // than we add a new number entered to that zero spot. As for (button -'0') this is simple ASCII table "trick" 0...9 in ASCII table are 48 ... 57,           // so by subtracting '0' from any of them we get their value in decade system ex. char '5' = 53 in decade numeric system minus 48 for zero char gives us value of actual 5,           // if our previous number was ex. 25 we get 250 by multiplying it with 10 and then we add 5 and we get 255 witch gets printed on LCD.           lcd.setCursor(0,0); // Select first row on lcd           lcd.print(num1); // Print current number1         }         if (num1 !=0 && (button=='-' || button=='+' || button=='*' || button=='/')) // If user is done inputing numbers         {           operation = button; // operation remembers what mathematical operation user wants on numbers           lcd.setCursor(0,1); // set cursor to row 2           lcd.print(operation); // print our operator           break;         }     }         while(1) // Second while loop, it loops untill user has pressed '=' or 'C'. so it either prints total or ressets program     {         if (button =='C'){break;} // This covers case where user pressed operator and still wants to reset         button = customKeypad.getKey();         if (button=='C') // Making sure user wants to reset at anytime         {           num1=0;           num2=0;           total=0;           operation=0;           lcd.clear();           break;         }         if (button >='0' && button <='9') // Getting chars from keypad for number 2         {           num2 = num2*10 + (button -'0');           lcd.setCursor(1,1);           lcd.print(num2);         }         if (button == '=' && num2 !=0)// If button pressed was '=' its the end of the road. Calls domath() subroutine does calculation and print our results         {           domath();                              break;          }     }     while(1)     {       // After all is done this loop waits for 'C' key to be pressed so it can reset program and start over.       if (button =='C'){break;} // This line is side effect of previous loop since if user pressed 'C' it breaks out of previous loop and continues here.So we need to break this one aswell or user would need to press 'C' 2 times       button = customKeypad.getKey();       if (button =='C')         {            lcd.clear();            lcd.setCursor(0,0);            num1=0;            num2=0;            total=0;            operation=0;            break;         }     } } void domath() // Simple switch case to pick what operation to do, based on button pressed by user. {   switch(operation)     {       case '+': // Addition           total = num1+num2;           break;             case '-': // Subtraction           total = num1-num2;           break;             case '/': // Division. Could add error for division by zero, or change line in second loop where it waits for '=' char to if (button == '=' && num2 != 0) this will halt program untill num2 is not zero and then continue           total = (float)num1/(float)num2;           break;             case '*': // Multiplication           total = num1*num2;           break;               }     // Based on case selected print our total and     lcd.setCursor(0,1);     lcd.print('=');     lcd.setCursor(1,1);     lcd.print(total);       } } // === MAIN LOOP END === Waiting your answers, Cristian

Question by IlirD2    |  last reply

: Arduino + Adafruit wave sheild + IR + Keypad sound board

Hi , was wondering if you could point me in the right direction I'm very new to Arduino I built last year a simple board with adafruit wave shield and added a simple 12 digit key pad to play 12 sounds + power up I have got the codes for the KEYES IR receiver so know the IR is correctly connected and library loaded im trying to integrate the IR code so can change the sounds by IR remote ideally with option of the buttons (if have to loose the buttons and just use remote that's fine) have copied the code below for how it works now just buttons   I found some code for Cylon Pumpkin that works great with just the remote but would also like to integrate the 12 digit keypad Thank you in advance for any help or pointers you can suggest Richard CODE FOR 12 DIGIT BUTTON PRESS /* ADAVOICE is an Arduino-based voice pitch changer plus WAV playback. Fun for Halloween costumes, comic convention getups and other shenanigans! Hardware requirements: - Arduino Uno, Duemilanove or Diecimila (not Mega or Leonardo compatible). - Adafruit Wave Shield - Speaker attached to Wave Shield output - Battery for portable use If using the voice pitch changer, you will also need: - Adafruit Microphone Breakout - 10K potentiometer for setting pitch (or hardcode in sketch) If using the WAV playback, you will also need: - SD card - Keypad, buttons or other sensor(s) for triggering sounds Software requirements: - WaveHC library for Arduino - Demo WAV files on FAT-formatted SD card This example sketch uses a 3x4 keypad for triggering sounds...but with some changes could be adapted to use several discrete buttons, Hall effect sensors, force-sensing resistors (FSRs), I2C keypads, etc. (or if you just want the voice effect, no buttons at all). Connections: - 3.3V to mic amp+, 1 leg of potentiometer and Arduino AREF pin - GND to mic amp-, opposite leg of potentiometer - Analog pin 0 to mic amp output - Analog pin 1 to center tap of potentiometer - Wave Shield output to speaker or amplifier - Matrix is wired to pins A2, A3, A4, A5 (rows) and 6, 7, 8 (columns) - Wave shield is assumed wired as in product tutorial Potentiometer sets playback pitch. Pitch adjustment does NOT work in realtime -- audio sampling requires 100% of the ADC. Pitch setting is read at startup (or reset) and after a WAV finishes playing. POINT SPEAKER AWAY FROM MIC to avoid feedback. Written by Adafruit industries, with portions adapted from the 'PiSpeakHC' sketch included with WaveHC library. */ #include #include SdReader card; // This object holds the information for the card FatVolume vol; // This holds the information for the partition on the card FatReader root; // This holds the information for the volumes root directory FatReader file; // This object represent the WAV file for a pi digit or period WaveHC wave; // This is the only wave (audio) object, -- we only play one at a time #define error(msg) error_P(PSTR(msg)) // Macro allows error messages in flash memory #define ADC_CHANNEL 0 // Microphone on Analog pin 0 // Wave shield DAC: digital pins 2, 3, 4, 5 #define DAC_CS_PORT PORTD #define DAC_CS PORTD2 #define DAC_CLK_PORT PORTD #define DAC_CLK PORTD3 #define DAC_DI_PORT PORTD #define DAC_DI PORTD4 #define DAC_LATCH_PORT PORTD #define DAC_LATCH PORTD5 uint16_t in = 0, out = 0, xf = 0, nSamples; // Audio sample counters uint8_t adc_save; // Default ADC mode // WaveHC didn't declare it's working buffers private or static, // so we can be sneaky and borrow the same RAM for audio sampling! extern uint8_t buffer1[PLAYBUFFLEN], // Audio sample LSB buffer2[PLAYBUFFLEN]; // Audio sample MSB #define XFADE 16 // Number of samples for cross-fade #define MAX_SAMPLES (PLAYBUFFLEN - XFADE) // Remaining available audio samples // Keypad information: uint8_t rows[] = { A2, A3, A4, A5 }, // Keypad rows connect to these pins cols[] = { 6, 7, 8, 9 }, // Keypad columns connect to these pins r = 0, // Current row being examined prev = 255, // Previous key reading (or 255 if none) count = 0; // Counter for button debouncing #define DEBOUNCE 10 // Number of iterations before button 'takes' // Keypad/WAV information. Number of elements here should match the // number of keypad rows times the number of columns, plus one: const char *sound[] = { "Crashing" , "Damaged", "InFlight" , "PowerUp" , // Row 1 = Darth Vader sounds "Brkdown3" , "Brkdown2" , "Brkdown" , "PowerUp" , // Row 2 = Godzilla sounds "Landing", "drain" , "Shutdown" , "PowerUp" , // Row 3 = Dug the dog sounds "Silent", "TakeOff", "Vortex" , "PowerUp" , // Row 4 = Cartoon/SFX sound "PowerUp" }; // Extra item = boot sound //////////////////////////////////// SETUP void setup() { uint8_t i; Serial.begin(9600); // The WaveHC library normally initializes the DAC pins...but only after // an SD card is detected and a valid file is passed. Need to init the // pins manually here so that voice FX works even without a card. pinMode(2, OUTPUT); // Chip select pinMode(3, OUTPUT); // Serial clock pinMode(4, OUTPUT); // Serial data pinMode(5, OUTPUT); // Latch digitalWrite(2, HIGH); // Set chip select high // Init SD library, show root directory. Note that errors are displayed // but NOT regarded as fatal -- the program will continue with voice FX! if(!card.init()) SerialPrint_P("Card init. failed!"); else if(!vol.init(card)) SerialPrint_P("No partition!"); else if(!root.openRoot(vol)) SerialPrint_P("Couldn't open dir"); else { PgmPrintln("Files found:");; // Play startup sound (last file in array). playfile(sizeof(sound) / sizeof(sound[0]) - 1); } // Optional, but may make sampling and playback a little smoother: // Disable Timer0 interrupt. This means delay(), millis() etc. won't // work. Comment this out if you really, really need those functions. TIMSK0 = 0; // Set up Analog-to-Digital converter: analogReference(EXTERNAL); // 3.3V to AREF adc_save = ADCSRA; // Save ADC setting for restore later // Set keypad rows to outputs, set to HIGH logic level: for(i=0; i pinMode(rows[i], OUTPUT); digitalWrite(rows[i], HIGH); } // Set keypad columns to inputs, enable pull-up resistors: for(i=0; i pinMode(cols[i], INPUT); digitalWrite(cols[i], HIGH); } while(wave.isplaying); // Wait for startup sound to finish... startPitchShift(); // and start the pitch-shift mode by default. } //////////////////////////////////// LOOP // As written here, the loop function scans a keypad to triggers sounds // (stopping and restarting the voice effect as needed). If all you need // is a couple of buttons, it may be easier to tear this out and start // over with some simple digitalRead() calls. void loop() { uint8_t c, button; // Set current row to LOW logic state... digitalWrite(rows[r], LOW); // ...then examine column buttons for a match... for(c=0; c if(digitalRead(cols[c]) == LOW) { // First match. button = r * sizeof(cols) + c; // Get button index. if(button == prev) { // Same button as before? if(++count >= DEBOUNCE) { // Yes. Held beyond debounce threshold? if(wave.isplaying) wave.stop(); // Stop current WAV (if any) else stopPitchShift(); // or stop voice effect playfile(button); // and play new sound. while(digitalRead(cols[c]) == LOW); // Wait for button release. prev = 255; // Reset debounce values. count = 0; } } else { // Not same button as prior pass. prev = button; // Record new button and count = 0; // restart debounce counter. } } } // Restore current row to HIGH logic state and advance row counter... digitalWrite(rows[r], HIGH); if(++r >= sizeof(rows)) { // If last row scanned... r = 0; // Reset row counter // If no new sounds have been triggered at this point, and if the // pitch-shifter is not running, re-start it... if(!wave.isplaying && !(TIMSK2 & _BV(TOIE2))) startPitchShift(); } } //////////////////////////////////// HELPERS // Open and start playing a WAV file void playfile(int idx) { char filename[13]; (void)sprintf(filename,"%s.wav", sound[idx]); Serial.print("File: "); Serial.println(filename); if(!, filename)) { PgmPrint("Couldn't open file "); Serial.print(filename); return; } if(!wave.create(file)) { PgmPrintln("Not a valid WAV"); return; }; } //////////////////////////////////// PITCH-SHIFT CODE void startPitchShift() { // Read analog pitch setting before starting audio sampling: int pitch = analogRead(1); Serial.print("Pitch: "); Serial.println(pitch); // Right now the sketch just uses a fixed sound buffer length of // 128 samples. It may be the case that the buffer length should // vary with pitch for better results...further experimentation // is required here. nSamples = 128; //nSamples = F_CPU / 3200 / OCR2A; // ??? //if(nSamples > MAX_SAMPLES) nSamples = MAX_SAMPLES; //else if(nSamples < (XFADE * 2)) nSamples = XFADE * 2; memset(buffer1, 0, nSamples + XFADE); // Clear sample buffers memset(buffer2, 2, nSamples + XFADE); // (set all samples to 512) // WaveHC library already defines a Timer1 interrupt handler. Since we // want to use the stock library and not require a special fork, Timer2 // is used for a sample-playing interrupt here. As it's only an 8-bit // timer, a sizeable prescaler is used (32:1) to generate intervals // spanning the desired range (~4.8 KHz to ~19 KHz, or +/- 1 octave // from the sampling frequency). This does limit the available number // of speed 'steps' in between (about 79 total), but seems enough. TCCR2A = _BV(WGM21) | _BV(WGM20); // Mode 7 (fast PWM), OC2 disconnected TCCR2B = _BV(WGM22) | _BV(CS21) | _BV(CS20); // 32:1 prescale OCR2A = map(pitch, 0, 1023, F_CPU / 32 / (9615 / 2), // Lowest pitch = -1 octave F_CPU / 32 / (9615 * 2)); // Highest pitch = +1 octave // Start up ADC in free-run mode for audio sampling: DIDR0 |= _BV(ADC0D); // Disable digital input buffer on ADC0 ADMUX = ADC_CHANNEL; // Channel sel, right-adj, AREF to 3.3V regulator ADCSRB = 0; // Free-run mode ADCSRA = _BV(ADEN) | // Enable ADC _BV(ADSC) | // Start conversions _BV(ADATE) | // Auto-trigger enable _BV(ADIE) | // Interrupt enable _BV(ADPS2) | // 128:1 prescale... _BV(ADPS1) | // ...yields 125 KHz ADC clock... _BV(ADPS0); // ...13 cycles/conversion = ~9615 Hz TIMSK2 |= _BV(TOIE2); // Enable Timer2 overflow interrupt sei(); // Enable interrupts } void stopPitchShift() { ADCSRA = adc_save; // Disable ADC interrupt and allow normal use TIMSK2 = 0; // Disable Timer2 Interrupt } ISR(ADC_vect, ISR_BLOCK) { // ADC conversion complete // Save old sample from 'in' position to xfade buffer: buffer1[nSamples + xf] = buffer1[in]; buffer2[nSamples + xf] = buffer2[in]; if(++xf >= XFADE) xf = 0; // Store new value in sample buffers: buffer1[in] = ADCL; // MUST read ADCL first! buffer2[in] = ADCH; if(++in >= nSamples) in = 0; } ISR(TIMER2_OVF_vect) { // Playback interrupt uint16_t s; uint8_t w, inv, hi, lo, bit; int o2, i2, pos; // Cross fade around circular buffer 'seam'. if((o2 = (int)out) == (i2 = (int)in)) { // Sample positions coincide. Use cross-fade buffer data directly. pos = nSamples + xf; hi = (buffer2[pos] << 2) | (buffer1[pos] >> 6); // Expand 10-bit data lo = (buffer1[pos] << 2) | buffer2[pos]; // to 12 bits } if((o2 < i2) && (o2 > (i2 - XFADE))) { // Output sample is close to end of input samples. Cross-fade to // avoid click. The shift operations here assume that XFADE is 16; // will need adjustment if that changes. w = in - out; // Weight of sample (1-n) inv = XFADE - w; // Weight of xfade pos = nSamples + ((inv + xf) % XFADE); s = ((buffer2[out] << 8) | buffer1[out]) * w + ((buffer2[pos] << 8) | buffer1[pos]) * inv; hi = s >> 10; // Shift 14 bit result lo = s >> 2; // down to 12 bits } else if (o2 > (i2 + nSamples - XFADE)) { // More cross-fade condition w = in + nSamples - out; inv = XFADE - w; pos = nSamples + ((inv + xf) % XFADE); s = ((buffer2[out] << 8) | buffer1[out]) * w + ((buffer2[pos] << 8) | buffer1[pos]) * inv; hi = s >> 10; // Shift 14 bit result lo = s >> 2; // down to 12 bits } else { // Input and output counters don't coincide -- just use sample directly. hi = (buffer2[out] << 2) | (buffer1[out] >> 6); // Expand 10-bit data lo = (buffer1[out] << 2) | buffer2[out]; // to 12 bits } // Might be possible to tweak 'hi' and 'lo' at this point to achieve // different voice modulations -- robot effect, etc.? DAC_CS_PORT &= ~_BV(DAC_CS); // Select DAC // Clock out 4 bits DAC config (not in loop because it's constant) DAC_DI_PORT &= ~_BV(DAC_DI); // 0 = Select DAC A, unbuffered DAC_CLK_PORT |= _BV(DAC_CLK); DAC_CLK_PORT &= ~_BV(DAC_CLK); DAC_CLK_PORT |= _BV(DAC_CLK); DAC_CLK_PORT &= ~_BV(DAC_CLK); DAC_DI_PORT |= _BV(DAC_DI); // 1X gain, enable = 1 DAC_CLK_PORT |= _BV(DAC_CLK); DAC_CLK_PORT &= ~_BV(DAC_CLK); DAC_CLK_PORT |= _BV(DAC_CLK); DAC_CLK_PORT &= ~_BV(DAC_CLK); for(bit=0x08; bit; bit>>=1) { // Clock out first 4 bits of data if(hi & bit) DAC_DI_PORT |= _BV(DAC_DI); else DAC_DI_PORT &= ~_BV(DAC_DI); DAC_CLK_PORT |= _BV(DAC_CLK); DAC_CLK_PORT &= ~_BV(DAC_CLK); } for(bit=0x80; bit; bit>>=1) { // Clock out last 8 bits of data if(lo & bit) DAC_DI_PORT |= _BV(DAC_DI); else DAC_DI_PORT &= ~_BV(DAC_DI); DAC_CLK_PORT |= _BV(DAC_CLK); DAC_CLK_PORT &= ~_BV(DAC_CLK); } DAC_CS_PORT |= _BV(DAC_CS); // Unselect DAC if(++out >= nSamples) out = 0; } CODE I FOUND FOR IR  ClyonPumpkin That I want to integrate in above   /* * Text-to-speech example to speak the first n digits of pi. * The number is stored in flash, each digit is spoken one at a time. */ #include #include #include SdReader card;    // This object holds the information for the card FatVolume vol;    // This holds the information for the partition on the card FatReader root;   // This holds the information for the volumes root directory FatReader file;   // This object represent the WAV file for a pi digit or period WaveHC wave;      // This is the only wave (audio) object, since we will only play one at a time char eyesound[13]="eye2.wav"; int mute = 0; /* * Define macro to put error messages in flash memory */ #define error(msg) error_P(PSTR(msg)) // IR Remote code int RECV_PIN = 9;  // pin 11 used by SD card interface so select pin 9 for IR IRrecv irrecv(RECV_PIN); decode_results results; long lasttime=0, lastcode=0, timediff=0; //////////////////////////////////// SETUP void setup() {   // set up Serial library at 9600 bps   Serial.begin(9600);               if (!card.init()) {     error("Card init. failed!");   }   if (!vol.init(card)) {     error("No partition!");   }   if (!root.openRoot(vol)) {     error("Couldn't open dir");   }   irrecv.enableIRIn(); // Start the IR receiver } /////////////////////////////////// LOOP void loop() {   if(mute == 0) playcomplete(eyesound);   // check for keypress happened   if (irrecv.decode(&results;)) {      Serial.println(results.value, HEX);      switch (results.value) {        case 0x83228B74:    // 1          playcomplete("command.wav");          break;        case 0x83228F70:    // 2          playcomplete("entertan.wav");          break;        case 0x8322906F:    // 3          playcomplete("extermin.wav");          break;        case 0x83228A75:    // 4          playcomplete("leader.wav");          break;        case 0x8322847B:    // 5          playcomplete("survivor.wav");          break;         case 0x83227887:    // 6          playcomplete("atention.wav");          break;        case 0x8322629D:    // vol up          mute = 0;         // mute off          break;         case 0x83226E91:    // mute          { Serial.println("mute detected");            timediff=millis()-lasttime;            Serial.println(timediff);            if(lastcode!=results.value || (lastcode==results.value && (timediff>1600)) ) {               if( mute == 0 ) { // is mute off?                  Serial.println("toggle off to on");                  mute = 1;      // turn on                  // delay(1000);    // wait a bit for debounce                  break;                 }               if( mute == 1 ) { // is mute on?                  mute = 0;      // turn off                  Serial.println("toggle on to off");                  break;                 }              } // end if             break;           } // end case        } // end switch      lastcode = results.value;      lasttime = millis();      irrecv.resume();   // Receive the next value   } } /////////////////////////////////// HELPERS /* * print error message and halt */ void error_P(const char *str) {   PgmPrint("Error: ");   SerialPrint_P(str);   sdErrorCheck();   while(1); } /* * print error message and halt if SD I/O error */ void sdErrorCheck(void) {   if (!card.errorCode()) return;   PgmPrint("\r\nSD I/O error: ");   Serial.print(card.errorCode(), HEX);   PgmPrint(", ");   Serial.println(card.errorData(), HEX);   while(1); } /* * Play a file and wait for it to complete */ void playcomplete(char *name) {   playfile(name);   while (wave.isplaying);     // see if an error occurred while playing   sdErrorCheck(); } /* * Open and start playing a WAV file */ void playfile(char *name) {   if (wave.isplaying) {// already playing something, so stop it!     wave.stop(); // stop it   }   if (!, name)) {     PgmPrintln("Couldn't open file ");     Serial.print(name);     return;   }   if (!wave.create(file)) {     PgmPrintln("Not a valid WAV");     return;   }   // ok time to play!; }

Topic by SithLordIII  

I need some expert mac help!!

Okay, I got a bit of a story, and a bit of a question (Las Vegas, I know you can help me). I've been transfered to a new highschool (not that new to me, I've been to it before) and I've been there for about 3 weeks now. I was given a thinkpad R51 by the school board while I was out of school to use for school work and to take to school. That's all fine and dandy, but the restrictions on their disc image are unbelievable and it makes it next to useless to me other than a gigantic calculator with a shitty battery life. So I wiped it of course, repartitioned it with a 30 and 10 gig partition (respectivly both NTFS, the backup partition, the 10 gig one, is currently in fat32 as I forgot macs can't write to NTFS). So everything works fine, when I got transfered to the school, I asked the so-called "head" techy teacher person of my school for the wep key for the wireless network in my school so I can print my work out in class instead of waiting till I got home (teachers don't like that sometimes). Since I've been to school he's made up excuses like "I know I have the wep key wrote down somewhere, but I know it'll take me like an hour to find it so I can't right now - I've been told that on 4 different occasions on 4 different days. Funny thing is that both he and I know that their wireless isn't actually pure wep mode. It's a wpa enterprise mode of some sort with a required username/password combination to log into it (that's fine though, it'll still work if I have the password). Oh yeah I forgot how I took my ibook to school one day, then the next day (no not the day I was showing him my ibook) he tells me that the wireless will work on my ibook, but not the thinkpad, which, like every other fucking laptop in the school, is a model R51 type 1829 with the odd old R40 laying around. It's excuses after excuses, my mother wanted to call in and give them hell for leading me around but I told her no, I'm curious to see how dumb this teacher thinks I am (and so far I've been playing dumb). NOW he tells me that I need to now, re-image my thinkpad with their school disc image they use on their machines, which I don't have to agree to doing because the laptop didn't come from this school and so it's not theirs. There was absolutely no reason it would not work as I even used the exact same wifi drivers/software and even the same profile management software they use on theirs. Now, I'm almost done but let me explain the last bit of why I'm even posting this lenghty (and possibly waste of time) post. I recently re-reformated as somehow I contracted a nasty trojan downloader onto it, and it was due for a clean up anyways. Well wasn't that a rough ride, since the reinstall I've had to wrestle a video driver onto it, fiddle around with all the other drivers to get them installed, and I still can't get a wifi driver to install. Even if I force install one from the "manual" option when XP asks for drivers (yes XP does have generic Intel Wifi lan drivers for my card) and it wouldn't go, just gave me an error 10 code (device cannot startup). Okay, so the driver isn't compatible? Well Lenovo only has 3 different wifi driver packages for different wifi internal cards for my "one" model/type of laptop (the type "1829" is lenovo's numbering system basically for revisions, and when I went on their site for drivers, it askes me for this, model, and a specific 3 digit number on the bottom (order code I think). So why it can't just tell me the specific card in my revision (as I'm sure there's probably only one card for my revision) is beyond me. I downloaded all three, the first two were just small driver/utility packages (I think they were only 802b drivers too, at least one of them was). When I tried to install them, no luck, first appeared to install it, although the drivers never installed apparently. So I uninstalled what (still) there, and tried the second, same thing, except nothing installed, but it appeared to install. So I went on to the last one, it appeared to be succesful. Not, for some reason, windows could list me all the ap's around here, but couldn't connect to them, or mine, and I know I put the right key in. And when I tried to use Ibm's utilites to connect, it kept crashing, and it was even crashing the wireless zero config windows service thing every time I tried to power on the wifi or such. However I don't even care about windows right now at this particular time or fixing the drivers, for all I know there was a scratch on the install cd and it's botched (very unlikely as I know the install would halt and say it can't read) Now because my teacher has been literally screwing around with me (I'm not assuming here that he's lying to me and making excuses, I know he is because it's just too obvious, you guys tell me). Plan? Install mac os x on the thinkpad and ask him again if it'll work and if he says no, I will probably rip him a new asshole right there on the spot, seeing as he's told me multiple times it will work on my mac, but not the thinkpad, so if I have mac software on there, shouldn't be a problem (hehe). I really want to do this to get back at my teacher because he doesn't believe anything I tell him and he thinks he's pretty smart, just generally another guy with a too-big ego for one person to handle. I downloaded the iAtkos disc image as directed by instructions I found through google (yes, torrent, illegal, don't harp on me for it, jobs makes enough as it is with ipod sales). It's supposed to be pre-patched, and also supposed to include additional driver packages of some kind (that's a plus). And to boot, it's supposed to boot off the dvd (lawl) without any tricks (like usb drives and that smutz). It all seems pretty sweet, and it did boot when I popped it in, but It went to the mac loading screen (the white one with the grey spiny thing) and just sits there with absolutely no activity. I booted it with the -v/-s command(s) and this is what comes up when it stops loading and sits: "Extension "" has immediate dependencies on both and components; use only one style." My understanding is that the plist file might be missing some components the driver is calling for, but the "use only one style" part doesn't make sense so I know it's something else. Although it didn't say, I presume the kernal was already patched as it was supposed to be a pure pop-in-and-go image. I was hoping to try installing the EFI patch after too if I can get it going in the first place. And yes, I did quite a bit of googleing before I came to here. I could find information on R40's with mac os x installed on them (or was it x40?, I know those are newer, the r40's are old) and other models inbetween but nothing on thinkpad. I don't even care if it's fast or works 100%, I just want to do it, I do also know that the atheros chipset in my wifi card is native compatible with tiger apparently and should show up as a standard airport card. I don't know if I'll be amazed or not when I post this finally and see how many pages long it is, but I do really need a hand, because this will be the final step before I go to the VP and tell him that this guy has been screwing around with me and blowing me off. I deserve and education dammit!

Topic by Punkguyta    |  last reply

Need help this fix arduino the error code please ?

Im still beginner in arduino and i dont have any tutor to ask for ,i put the spi and mfrc522 library already ,please help me fix this error The copy error messages Arduino: 1.8.4 (Windows 7), Board: "Arduino/Genuino Uno" sketch_sep10a_teqj:10: error: 'MIFARE_Key' in 'class MFRC522' does not name a type MFRC522::MIFARE_Key key;           ^ sketch_sep10a_teqj:13: error: array must be initialized with a brace-enclosed initializer byte keyA[6] = (0x38,0xf5,0x86,0x03,0x3c,0x2a);  //KeyA                                               ^ sketch_sep10a_teqj:21: error: 'mfrc522' does not name a type mfrc522.PCD_Init()://Init MFRC522 card ^ C:\Users\Muhammad Adli\Documents\Arduino\sketch_sep10a_teqj\sketch_sep10a_teqj.ino: In function 'void loop()': sketch_sep10a_teqj:27: error: invalid use of member function (did you forget the '()' ?)    Serial.begin = "*";                 ^ sketch_sep10a_teqj:28: error: 'class MFRC522' has no member named 'PICC_IsNewCardPresent'    if ( ! mfrc522.PICC_IsNewCardPresent()) {                   ^ sketch_sep10a_teqj:35: error: 'class MFRC522' has no member named 'PICC_ReadCardSerial'    if (! mfrc522.PICC_ReadCardSerial()                  ^ sketch_sep10a_teqj:36: error: expected ')' before '}' token }{ ^ sketch_sep10a_teqj:36: error: expected primary-expression before '}' token C:\Users\Muhammad Adli\Documents\Arduino\sketch_sep10a_teqj\sketch_sep10a_teqj.ino: At global scope: sketch_sep10a_teqj:36: error: expected unqualified-id before '{' token }{   ^ sketch_sep10a_teqj:48: error: 'Serial' does not name a type Serial.printIn(); ^ sketch_sep10a_teqj:49: error: 'Serial' does not name a type Serial.print(PROGMEM(*Card UID: *)); ^ sketch_sep10a_teqj:50: error: expected constructor, destructor, or type conversion before '(' token printHEX(mfrc522.uid.uidByte, mfrc522.uid.size);          ^ sketch_sep10a_teqj:52: error: 'Serial' does not name a type Serial.printIn(); ^ sketch_sep10a_teqj:53: error: 'Serial' does not name a type Serial.print(PROGMEM("PICC type: *")); ^ sketch_sep10a_teqj:54: error: 'PICC_Type' in 'class MFRC522' does not name a type MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);           ^ sketch_sep10a_teqj:55: error: 'Serial' does not name a type Serial.printIn(mfrc522.PICC_GetTypeName(piccType)); ^ sketch_sep10a_teqj:58: error: expected unqualified-id before 'if' if (    piccType != MFRC522::PICC_TYPE_MIFARE_MINI ^ sketch_sep10a_teqj:64: error: expected unqualified-id before 'return'              return;              ^ sketch_sep10a_teqj:68: error: 'StatusCode' in 'class MFRC522' does not name a type MFRC522::StatusCode status;           ^ sketch_sep10a_teqj:72: error: expected unqualified-id before 'for'              for (byte i = 0; i < MFRC522::MF_KEY_SIZE; i++)              ^ sketch_sep10a_teqj:72: error: 'i' does not name a type              for (byte i = 0; i < MFRC522::MF_KEY_SIZE; i++)                               ^ sketch_sep10a_teqj:72: error: 'i' does not name a type              for (byte i = 0; i < MFRC522::MF_KEY_SIZE; i++)                                                         ^ sketch_sep10a_teqj:78: error: 'Serial' does not name a type Serial.print (PROGMEM("Authenticating with key A...: )"); ^ sketch_sep10a_teqj:79: error: 'status' does not name a type                status = (MFRC522::StatusCode) mfrc522.PCD_Authenticate(MFRC522 ::                ^ sketch_sep10a_teqj:81: error: expected unqualified-id before 'if' if (status != MFRC522::STATUS_OK) { ^ sketch_sep10a_teqj:88: error: expected unqualified-id before 'else' else ^ sketch_sep10a_teqj:92: error: 'Serial' does not name a type    Serial.print(PROGMEM("Reading data from block "));    ^ sketch_sep10a_teqj:93: error: 'Serial' does not name a type    Serial.printIn(blockNoStaff);    ^ sketch_sep10a_teqj:94: error: 'status' does not name a type    status = (MFRC522::StatusCode) mfrc522.MIFARE_Read(blockNoStaff, buffer, &size;);    ^ sketch_sep10a_teqj:95: error: expected unqualified-id before 'if'    if (status != MFRC522::STATUS_OK) {    ^ sketch_sep10a_teqj:100: error: expected unqualified-id before 'for' for (byte i = 0; i <= 15; i++) { ^ sketch_sep10a_teqj:100: error: 'i' does not name a type for (byte i = 0; i <= 15; i++) {                   ^ sketch_sep10a_teqj:100: error: 'i' does not name a type for (byte i = 0; i <= 15; i++) {                            ^ sketch_sep10a_teqj:106: error: 'Serial' does not name a type Serial.print(PROGMEM("Raw Data in block")); ^ sketch_sep10a_teqj:107: error: 'Serial' does not name a type Serial.print(blockNoStaff); ^ sketch_sep10a_teqj:108: error: 'Serial' does not name a type Serial.printIn(PROGMEM(":")); ^ sketch_sep10a_teqj:109: error: expected constructor, destructor, or type conversion before '(' token printHex(buffer, 16);          ^ sketch_sep10a_teqj:112: error: expected constructor, destructor, or type conversion before '(' token decode(byte_serial, byte_nostaf, byte_key);        ^ sketch_sep10a_teqj:113: error: 'Serial' does not name a type Serial.printIn(" "); ^ sketch_sep10a_teqj:114: error: 'Serial' does not name a type Serial.printIn("No Staf after decode: "); ^ sketch_sep10a_teqj:115: error: expected constructor, destructor, or type conversion before '(' token printIn(byte_nostaf, 10);         ^ sketch_sep10a_teqj:125: error: 'mfrc522' does not name a type mfrc522.PICC_HaltA(); ^ sketch_sep10a_teqj:127: error: 'mfrc522' does not name a type mfrc522.PCD_StopCryptol(); ^ sketch_sep10a_teqj:128: error: expected declaration before '}' token } ^ exit status 1 'MIFARE_Key' in 'class MFRC522' does not name a type This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences. THIS the code: #include #include #define  RST_PIN     9   // MFRC Reset Pin #define  SS_PIN      10  // MFRC SPI Pin MFRC522 mfrc522(SS_PIN, RST_PIN); //Create MFRC522 instance. MFRC522::MIFARE_Key key; byte blockNoStaf = 10; byte keyA[6] = (0x38,0xf5,0x86,0x03,0x3c,0x2a);  //KeyA String nostaf; String serial; byte byte_nostaf[16]; byte byte_serial[4]; byte byte_key[4] = {0xb5,0xcf,0x60,0x71}; mfrc522.PCD_Init()://Init MFRC522 card   Serial.printIn(("Sedia untuk imbas kad staffUSM"));   // put your setup code here, to run once:   void loop() {   Serial.begin = "*";   if ( ! mfrc522.PICC_IsNewCardPresent()) {     //TODO: RED LED ON indicate error     //TODO: Display error at LCD Display     return;   }   // 2 Select one of the cards   if (! mfrc522.PICC_ReadCardSerial() }{ //TODO: RED LED ON indicate error //TODO: Display error at LCD Display return; //get the card UID for (byte i = 0; i < mfrc522.uid.size; i++)(       Serial += String(mfrc522.uid.uidByte[i], HEX);       byte-Serial[i] = mfrc522.uid.uidByte[i];   } // 3 show some detail of the PICC (hat is: the tag /card) Serial.printIn(); Serial.print(PROGMEM(*Card UID: *)); printHEX(mfrc522.uid.uidByte, mfrc522.uid.size); Serial.printIn(); Serial.print(PROGMEM("PICC type: *")); MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak); Serial.printIn(mfrc522.PICC_GetTypeName(piccType)); //3.1 Check for compatibility if (    piccType != MFRC522::PICC_TYPE_MIFARE_MINI         &&  piccType != MFRC522::PICC_TYPE_MIFARE_IK         &&  piccType != MFRC522::PICC_TYPE_MIFARE_4K) (             Serial.printIn(PROGMEM("This sample only works with MIFARE Classic cards.*"));             //TODO: RED LED ON indicate error             //TODO: Display error at LCD Display             return; MFRC522::StatusCode status; byte buffer[18]; byte size = sizeof(buffer);             for (byte i = 0; i < MFRC522::MF_KEY_SIZE; i++)             key.keyByte[i] = keyA[i]; // 4 Authenticate using key A Serial.print (PROGMEM("Authenticating with key A...: )");               status = (MFRC522::StatusCode) mfrc522.PCD_Authenticate(MFRC522 ::                        PICC_CMD_MF_AUTH_KEY_A, blockNoStaff, &key;, &(mfrc522.uid)); if (status != MFRC522::STATUS_OK) { Serial.print (PROGMEM("PCD_Authenticate() failed: "));   Serial.printIn(mfrc522.GetStatusCodeName(status));   //TODO: RED LED for error   //TODO: Display Error on LCD   return; } else   Serial.printIn("success");   //  5 Read data from the block   Serial.print(PROGMEM("Reading data from block "));   Serial.printIn(blockNoStaff);   status = (MFRC522::StatusCode) mfrc522.MIFARE_Read(blockNoStaff, buffer, &size;);   if (status != MFRC522::STATUS_OK) {   Serial.print(PROGMEM("MIFARE_Read()"" failed "));     Serial.printIn(mfrc522.GetStatusCodeName(status));   } for (byte i = 0; i <= 15; i++) { nostaf += String(buffer[i], HEX);   byte_nostaf[i] = buffer[i]; } Serial.print(PROGMEM("Raw Data in block")); Serial.print(blockNoStaff); Serial.printIn(PROGMEM(":")); printHex(buffer, 16); // 5 decode data dalam kad decode(byte_serial, byte_nostaf, byte_key); Serial.printIn(" "); Serial.printIn("No Staf after decode: "); printIn(byte_nostaf, 10); // 6 hantar nostaf ke frapi guna ethernet modul // 7 papar result // LED Hijau success // LED Merah failed // Papar result pada LCD // Halt PICC mfrc522.PICC_HaltA(); // Stop encryption on PCD mfrc522.PCD_StopCryptol(); } void printHex(byte *buffer, byte buffersize) for (byte i = 0; i < buffersize; i++;) { Serial.print(buffer[i] < 0 * 10 ? " 0 " : " ");   Serial.print(buffer[i], HEX); } } void printDec(byte *buffer, byte bufferSize) {   for (byte i = 0; i < bufferSize; i++;) {     //  Serial.print(buffer[i] < 0*10 ? " 0 " : " ");     Serial.print(buffer[i], DEC);   } } void printBin(byte *buffer, byte bufferSize) {   for (byte i = 0; i < bufferSize; i++) {     Serial.print(buffer[i], BIN); Serial.print(" ");   } } void printIn(byte *buffer, byte bufferSize) {   for (byte i = 0; i < bufferSize; i++) {     Serial.write(buffer[i]); Serial.print(" ");   } } void decode (byte *serial, byte *nostaf, byte *key) {   int j = 0;   for (int i = 0; i <= 15; i++) {     j = i % 4;     int a = serial[j] ^ key[j];     nostaf[i] = a ^ nostaf[i];   } }

Question by rosedgonzo    |  last reply

Fastest you have ever been.

I have a car, but no permit or license. One day, my brother told me to bring him something while he was at work. I was driving down the street going the speed limit or a little over and under. I turned onto the main road Speed limit, 50mph, and just went 50 or so the whole way. and when i got back onto the highway, this guy is following me to my bumper basically, so in the non passing zone just getting on i am going about 25mph, as you are getting on it is 35mph limit, as soon as it reaches 50mph, i jam the gas, it goes into passing gear and in no time i am doing 80mph. and on an S-curve still doing 80. On the stretch i am doing about 60mph, and decided i should just stick to the speed limit. Got a story? A Nice Morning Drive It was a fine morning in March 1982. The warm weather and clear sky gave promise of an early spring. Buzz had arisen early that morning, impatiently eaten breakfast and gone to the garage. Opening the door, he saw the sunshine bounce off the gleaming hood of his 15-year-old MGB roadster. After carefully checking the fluid levels, tire pressures and ignition wires, Buzz slid behind the wheel and cranked the engine, which immediately fired to life. He thought happily of the next few hours he would spend with the car, but his happiness was clouded - it was not as easy as it used to be. A dozen years ago things had begun changing. First there were a few modest safety and emission improvements required on new cars; gradually these became more comprehensive. The governmental requirements reached an adequate level, but they didn't stop; they continued and became more and more stringent. Now there were very few of the older models left, through natural deterioration and . . . other reasons. The MG was warmed up now and Buzz left the garage, hoping that this early in the morning there would be no trouble. He kept an eye on the instruments as he made his way down into the valley. The valley roads were no longer used very much: the small farms were all owned by doctors and the roads were somewhat narrow for the MSVs (Modern Safety Vehicles). The safety crusade had been well done at first. The few harebrained schemes were quickly ruled out and a sense of rationality developed. But in the late Seventies, with no major wars, cancer cured and social welfare straightened out, the politicians needed a new cause and once again they turned toward the automobile. The regulations concerning safety became tougher. Cars became larger, heavier, less efficient. They consumed gasoline so voraciously that the United States had had to become a major ally with the Arabian countries. The new cars were hard to stop or maneuver quickly, but they would save your life (usually) in a 50-mph crash. With 200 million cars on the road, however, few people ever drove that fast anymore. Buzz zipped quickly to the valley floor, dodging the frequent potholes which had developed from neglect of the seldom-used roads. The engine sounded spot-on and the entire car had a tight, good feeling about it. He negotiated several quick S-curves and reached 6000 in third gear before backing off for the next turn. He didn't worry about the police down here. No, not the cops . . . Despite the extent of the safety program, it was essentially a good idea. But unforeseen complications had arisen. People became accustomed to cars which went undamaged in 10-mph collisions. They gave even less thought than before to the possibility of being injured in a crash. As a result, they tended to worry less about clearances and rights-of-way, so that the accident rate went up a steady six percent every year. But the damages and injuries actually decreased, so the government was happy, the insurance industry was happy and most of the car owners were happy. Most of the car owners - the owners of the non-MSV cars - were kept busy dodging the less careful MSV drivers, and the result of this mismatch left very few of the older cars in existence. If they weren't crushed between two 6000-pound sleds on the highway they were quietly priced into the junkyard by the insurance peddlers. And worst of all, they became targets . . . Buzz was well into his act now, speeding through the twisting valley roads with all the skill he could muster, to the extent that he had forgotten his earlier worries. Where the road was unbroken he would power around the turns in well controlled oversteer, and where the sections were potholed he saw them as devious chicanes to be mastered. He left the ground briefly going over one of the old wooden bridges and later ascertained that the MG would still hit 110 on the long stretch between the old Hanlin and Grove farms. He was just beginning to wind down when he saw it, there in his mirror, a late-model MSV with hand-painted designs covering most of its body (one of the few modifications allowed on post-1980 cars). Buzz hoped it was a tourist or a wayward driver who got lost looking for a gas station. But now the MSV driver had spotted the MG, and with a whoosh of a well muffled, well cleansed exhaust he started the chase . . . It hadn't taken long for the less responsible element among drivers to discover that their new MSVs could inflict great damage on an older car and go unscathed themselves. As a result some drivers would go looking for the older cars in secluded areas, bounce them off the road or into a bridge abutment, and then speed off undamaged, relieved of whatever frustrations cause this kind of behavior. Police seldom patrolled these out-of-the-way places, their attentions being required more urgently elsewhere, and so it became a great sport for some drivers. Buzz wasn't too worried yet. This had happened a few times before, and unless the MSV driver was an exceptionally good one, the MG could be called upon to elude the other driver without too much difficulty. Yet something bothered him about this gaudy MSV in his mirror, but what was it? Planning carefully, Buzz let the other driver catch up to within a dozen yards or so, and then suddenly shot off down a road to the right. The MSV driver stood on his brakes, skidding 400 feet down the road, made a lumbering U-turn and set off once again after the roadster. The MG had gained a quarter mile in this manner and Buzz was thankful for the radial tires and front and rear anti-roll bars he had put on the car a few years back. He was flying along the twisting road, downshifting, cornering, accelerating and all the while planning his route ahead. He was confident that if he couldn't outrun the MSV then he could at least hold it off for another hour or more, at which time the MSV would be quite low on gas. But what was it that kept bothering him about the other car? They reached a straight section of the road and Buzz opened it up all the way and held it. The MSV was quite a way back but not so far that Buzz couldn't distinguish the tall antenna standing up from the back bumper. Antenna! Not police, but perhaps a Citizen's Band radio in the MSV? He quaked slightly and hoped it was not. The straight stretch was coming to an end now and Buzz put off braking to the last fraction of a second and then sped through a 75-mph right-hander, gaining ten more yards on the MSV. But less than a quarter mile ahead another huge MSV was slowly pulling across the road and to a stop. It was a CB set. The other driver had a cohort in the chase. Now Buzz was in trouble. He stayed on the gas until within a few hundred feet when he banked hard and feinted passing to the left. The MSV crawled in that direction and Buzz slipped by on the right, bouncing heavily over a stone on the shoulder. The two MSVs set off in hot pursuit, almost colliding in the process. Buzz turned right at the first crossroad and then made a quick left, hoping to be out of sight of his pursuers, and in fact he traveled several minutes before spotting one of them on the main road parallel to his lane. At the same time the other appeared in the mirror from around the last comer. By now they were beginning to climb the hills on the far side of the valley and Buzz pressed on for all he was worth, praying that the straining engine would stand up. He lost track of one MSV when the main road turned away, but could see the other one behind him on occasion. Climbing the old Monument Road, Buzz hoped to have time to get over the top and down the old dirt road to the right, which would be too narrow for his pursuers. Climbing, straining, the water temperature rising, using the entire road, flailing the shift lever back and forth from 3rd to 4th, not touching the brakes but scrubbing off the necessary speed in the corners, reaching the peak of the mountain where the lane to the old fire tower went off to the left . . . but coming up the other side of the hill was the second MSV he had lost track of! No time to get to his dirt road. He made a panicked turn left onto the fire tower road but spun on some loose gravel and struck a tree a glancing blow with his right fender. He came to a stop on the opposite side of the road. the engine stalled. Hurriedly he pushed the starter while the overheated engine slowly came back into life. He engaged 1st gear and sped off up the road, just as the first MSV turned the corner. Dazed though he was, Buzz had the advantage of a very narrow road lined on both sides with trees, and he made the most of it. The road twisted constantly and he stayed in 2nd with the engine between 5000 and 5500. The crash hadn't seemed to hurt anything and he was pulling away from the MSV. But to where? It hit him suddenly that the road dead-ended at the fire tower, no place to go but back . . . Still he pushed on and at the top of the hill drove quickly to the far end of the clearing, turned the MG around and waited. The first MSV came flying into the clearing and aimed itself at the sitting MG. Buzz grabbed reverse gear, backed up slightly to feint, stopped, and then backed up at full speed. The MSV, expecting the MG to change direction, veered the wrong way and slid to a stop up against a tree. Buzz was off again, down the fire tower road, and the undamaged MSV set off in pursuit. Buzz's predicament was unenviable. He was going full tilt down the twisting blacktop with a solid MSV coming up at him. and an equally solid MSV coming down after him. On he went, however, braking hard before each turn and then accelerating back up to 45 in between. Coming down to a particularly tight turn, he saw the MSV coming around it from the other direction and stood on the brakes. The sudden extreme pressure in the brake lines was too much for the rear brake line which had been twisted somewhat in his spin, and it broke, robbing Buzz of his brakes. In sheer desperation he pulled the handbrake as tightly as it would go and rammed the gear lever into 1st, popping the clutch as he did so. The back end locked solid and broke away, spinning him off the side of the road and miraculously into some bushes, which brought the car to a halt. As he was collecting his senses, Buzz saw the two MSVs, unable to stop in time, ram each other head on at over 40 mph. It was a long time before Buzz had the MG rebuilt to its original pristine condition of before the chase. It was an even longer time before he went back into the valley for a drive. Now it was only in the very early hours of the day when most people were still sleeping off the effects of the good life. And when he saw in the papers that the government would soon be requiring cars to be capable of withstanding 75-mph headon collisions, he stopped driving the MG altogether. Written by: Richard Foster

Topic by Yerboogieman    |  last reply