growing in pastures. several plants with and without yellow buds.
your plant is a Rattlebox, most likely Crotalaria spectabilis, an attractive species of legume [Bean Family]. It is not edible, though. Most people consider it a weed because it is not uncommon on roadsides.
By the way, it would be nice to have more information when an image is sent in! I hope this helps. Sincerely, Steve Hill