Did people know it was being developed before it was used? If so, for how long? What was the public reaction?
It seems as though it would have been one of the most astounding and unprecedented events in human history. Was it viewed as such? Was there controversy?
The project to make the atomic bomb was kept a secret throughout the war. The general public was not informed.
After the bombing of Hiroshima, a very carefully planned "publicity" (their term) campaign began, launched by the people who made the bomb. First was a press release sent out under Truman's name. (Truman did not write it — the Vice President for Marketing of AT&T did, as a consultant to the bomb project.) The initial release gave basic information about the creation and use of the bomb.
Second was a longer statement by the Secretary of War released a few hours later, which gave more technical information on its creation. The British also released a press statement about their part in making it. All of these press releases and statements were prepared weeks before the Hiroshima attack.
At the same time, newspapers were given ready-made news stories about the bombing, the Manhattan Project, the scientists, the first nuclear test, etc. These were prepared months in advance by the New York Times journalist William L. Laurence, who worked as a consultant to the project and was the only "embedded" reporter within it. He was at the Trinity test and also flew along on the Nagasaki mission. (His reporting on Nagasaki won him the Pulitzer prize.) Laurence's work was heavily edited by the Army to make sure it had the right tone and information (he had a tendency to write very colorful, purple prose and they didn't like that). This information was given out without a byline and any reporter could use it as the basis of their own story.
Some further releases were made in the days after Hiroshima. The most important was the release of the Smyth Report, released a few days after the Nagasaki bombing. This was a technical history of the development of the atomic bomb, giving a lot of information out about how it was made, how atomic bombs work, and also telling everyone who worked on the project what the limits were for talking about the project. If it was in the Smyth Report, it was considered unclassified; if it was not, consider it still secret.
All of these releases served multiple purposes. They fulfilled, in the eyes of those who made them, the basic requirements for informing the democratic American public about what they considered the most important issue of the day. The initial press releases were also meant to convince the Japanese of the reality of the atomic bombs as well, in the hopes that they would surrender. (The author of the Truman press release said he hoped the Japanese would "capitulate to the power of the universe" if they saw that even nature itself was against them.)
They also explicitly served the purposes of security. The head of the Manhattan Project believed that if the bomb was announced but no more information was forthcoming, the American free press would swarm over the story. He feared that in such an environment a lot of sensitive information would be released. This was a judgment gained from previous experience with the press, when it was found that saying "no comment" produced more interest, not less, in what they were doing on the bomb project. So the strategy for the "publicity" was to overwhelm the news media with "safe" information that they could write about, so that they couldn't even tell what was being held back from them. They also threatened the workers on the project with dire consequences if they went beyond the officially released material.
So this "publicity" approach was liked by both the security people and the people who believed in informing a democratic public — it served both aims.
Of course, it also meant that a lot of information was not released. In the early years there was sometimes very confused information put out, and a lot held back. For example, a scientist tangentially connected with the project made an announcement that Hiroshima would be uninhabitable for decades because of the bombing. This provoked a very swift official denial from the Army and the scientists who worked as its spokesmen. The cumulative effect was that the public got somewhat misinformed on radiation — the initial scientist was wrong, but so was the denial. The truth was somewhere in between, though the details of radiation exposure at Hiroshima and Nagasaki took several years to pin down. But what the public got was a presentation of two extremes, neither of which were quite right.
There were other issues as well. These early stories were all developed by the people who made the bombs and so there was not a lot of discussion about alternatives pursued, about the less savory aspects, about decisions that might not look like it was anything but a great idea. Criticisms started to mount after a time and more official versions of the story were put out. The development of a truly independent understanding of this history took many decades. Even today a lot of what people spout as the "orthodox" history of the atomic bomb is actually just a story that was created by the people who stood the most to gain by it; the reality is often more complex.
You have probably heard about how militarily important Hiroshima and Nagasaki were, for example. They had some military relevance but they were considered minor targets by the Army Air Forces prior to the atomic bombing. Nagasaki was considered so relatively unimportant that it did not even have to be "reserved" for atomic attack like Hiroshima did. The cities were in fact chosen because they had some military and industry embedded in a larger civilian population, which would make the most psychological effect, from the perspective of the people who chose the targets. That kind of information was not released until many decades later, because it might cast doubt on the official version of things. Documents like this one that reveal what the actual thinking was at that time show it to be more complex and nuanced than the versions presented in the initial official accounts.
The American public reaction was primarily positive but laced with uncertainty and misgivings. Whether the first use of such a weapon should have been on a mostly-civilian city, whether the bomb should have been used at all, whether this was a definite good or the beginning of a very scary era — these kinds of questions were being asked from the day after Hiroshima forward. Some of the biggest critics of the use of the bomb were Army officers and conservatives, though you'd never know that from the way we talk about it today. The public reaction has been a very complex and shifting one over the years and is hard to sum up.
For further reading, Spencer Weart's Nuclear Fear: A History of Images is an excellent place to start. I am in the process of writing a book on the subject of nuclear secrecy and will have a chapter devoted to the "publicity" campaign.
The general public had no idea that the atomic bomb was being developed until it was first used on Hiroshima. The Manhattan Project (as it was known) worked in total secrecy. While scientists had discussed the possibility of using nuclear power in some way, no information leaked out ahead of time, including the explosion of the test bomb on July 16, 1945 in the western United States desert. There are many great articles in the New York Times archive that include interviews with scientists who claimed surprise at its development. The first to review is the New York Times issue of August 7, 1945. You will find many articles that discussed the total secrecy.