This work develops an adaptive scheduling algorithm for real-time energy harvesting embedded systems. The algorithm considers both energy and timing constraint of the energy harvesting systems unlike most of the scheduling algorithms. An AFP prediction algorithm was also proposed for a better energy prediction for each slot. Based on this information the initial scheduling, which was designed using the information given by EWMA prediction algorithm, was rescheduled. The purpose was successfully achieved by compensating the extra/less energy harvested from the environment in such a way so that system wide efficiency can be achieved. Using adaptive scheduling we were successfully able to decrease the deadline miss rate of the tasks up to 15-30% in addition to the results accomplished by initial scheduling depending on the amount of energy harvested.